OCJP

Total alphabet & capital & small

#include<stdio.h>
#include<conio.h>
void main()
{
char nm[12];
int i,c,s;
c=0;
s=0;
clrscr();
printf("\n enter name:");
scanf("%s",&nm);
for(i=0;nm[i]!=NULL;i++)
{
printf("\n char %c at %d",nm[i],i);
if(nm[i]>='A'&& nm[i]<='Z')
{
c++;
}
else if(nm[i]>='a'&& nm[i]<='z')
{
s++;
}
 }
 printf("\n total capital is %d and small is %d",c,s);
getch();

}

Leave a Reply

Your email address will not be published. Required fields are marked *


× How can I help you?