C Programming Beginner

Go down

C Programming Beginner

Post  Admin on 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

View user profile http://carriermaja.up-with.com

Back to top Go down

Back to top

- Similar topics

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