Posted by MindBreaker 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.