Fun- N- Info.com
Would you like to react to this message? Create an account in a few clicks or log in to continue.

C Programming Beginner

Go down

C Programming  Beginner Empty C Programming Beginner

Post  Admin Wed Jun 18, 2008 2:22 am

Find the number of occurrences of the alphabet 'o' in the word "Microsoft" using loop.

#include
using namespace std;
int main()
{ char s[]="Microsoft";
int j,k=0;
for (j=0;s[j]!='t';j++)
{if (s[j]=='o')
k++;
}
cout<<"Occurrence of o ="<system("pause");
return 0;
}

Admin
Admin

Posts : 129
Join date : 2008-04-18

https://carriermaja.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum