Answer to Question #19715 in Action Script | Flash | Flex | ColdFusion for BHUVANESH I

Question #19715
write a "c" program to count no.of numerals,uppercase,and specia lcharacter
1
Expert's answer
2012-11-30T06:31:16-0500

include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>

void main()
{
char str[30];
int i,dig=0,low=0,up=0,sp=0;
clrscr();
printf("Enter string : ");
gets(str);
for(i=0;i<strlen(str);i++)
{
if(str[i]>='0'&&str[i]<='9')
dig++;
else if(str[i]>='a'&&str[i]<='z')
low++;
else if(str[i]>='A'&&str[i]<='Z')
up++;
else
sp++;
}
printf("
digits : %d
lower case letters : %d
upper case letters :
%d
special characters : %d",dig,low,up,sp);

getch();

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS