Construct a C program to count the total number of upper and lower case letters for the accepted input statement.
Answers
Answered by
27
ANSWER
.........
#include<stdio.h>
#include<conio.h>
void main()
{
int upper=0
,lower=0;
char ch[80]
;
int i; clrscr();
******. printf
("\nEnter The String : ")
;
gets(ch); i=0; while(ch[i]!='')
{
if(ch[i]>='A' && ch[i]<='Z')
upper++; if(ch[i]>='a' && ch[i]<='z')
lower++; i++;
}
printf.
("\nUppercase Letters : %d",upper);
printf
("\nLowercase Letters : %d",lower); getch();
}
Output :
Enter The String : Pritesh A Taral Uppercase Letters : 3 Lowercase Letters : 10
.........
#include<stdio.h>
#include<conio.h>
void main()
{
int upper=0
,lower=0;
char ch[80]
;
int i; clrscr();
******. printf
("\nEnter The String : ")
;
gets(ch); i=0; while(ch[i]!='')
{
if(ch[i]>='A' && ch[i]<='Z')
upper++; if(ch[i]>='a' && ch[i]<='z')
lower++; i++;
}
printf.
("\nUppercase Letters : %d",upper);
printf
("\nLowercase Letters : %d",lower); getch();
}
Output :
Enter The String : Pritesh A Taral Uppercase Letters : 3 Lowercase Letters : 10
Similar questions