prev


for loop

113.Count Upper & lower case and digit until $ (27.07.2010)

/*
Program# 113
date : 14-01-2009
Count Upper & lower case and digit until $
*/

#include <stdio.h>
main(){
char ch;
int u,l,s,d;
u=l=s=d=0;

for(scanf("%c",&ch);ch!='$';scanf("%c",&ch))
if(ch>=65 && ch<=90)
u++;
else if(ch>=97 && ch<=122)
l++;
else if(ch>=48 && ch<=57)
d++;
else
s++;
printf("\n Upper %d \t Lower %d \t Special %d \t Digit %d",u,l,s,d);
}



next
blog comments powered by Disqus