2012-11-29T07:11:09-05:00
write a "c" program to count no.of numerals,uppercase,and specia lcharacter
1
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 !
Learn more about our help with Assignments:
Adobe Flash
Comments