#include<stdio.h>
#include<conio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
void main ()
void main ()
{
char *st;
char *st;
int i,l,upper=0,lower=0,digit=0,space=0,other=0;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
if(*(st+i)>="a"&& *(st+i)<="z")
lower++;
else if(*(st+i)>="A" && *(st+i)<="Z")
upper++;
else if(*(st+i)>="0" && *(st+i)<="9")
digit++;
else if(*(st+i)>==" ")
space++;
else
other++;
printf("\nUpper= %d", upper);
printf("\nlower= %d", lower);
printf("\ndigit= %d", digit);
printf("\nspace= %d", space);
printf("\nother= %d", other);
getch ();
}
}
No comments:
Post a Comment