Comments

Tuesday, August 27, 2013

Find the Uppercase lower case in sentences

Posted by at 3:56 AM Read our previous post


Object:
Find the Uppercase lower case in sentences
Source Code:
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
using namespace std;



void main()
{
      
int word,upper=0,lower=0;
char ch;

cout<<"Enter Sentence"<<endl;
while((ch = getchar()) != '\n')
{
       word=ch;
              if (word >61 && word<87)
           {
                     upper ++;
              }

              if (word >91 && word <127)
              {
                     lower++;
              }
}
      
cout<<"Counted Uppercase Words : \n"<<upper<<"Counted Lowercase words : "<<lower;

}

Output:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Popular Posts

Labels

© Codepirate is powered by Blogger - Template designed by Stramaxon - Best SEO Template