Created
September 19, 2014 02:41
-
-
Save shohan4556/3f20916f679baf1fde3a to your computer and use it in GitHub Desktop.
letter counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
char str[100]; | |
int i=0,nl=0; | |
gets(str); // it takes input with space | |
while(str[i] !='\0') // null termination character, it marks the the end of string | |
{ | |
char ch= str[i]; | |
if (ch>= 'A' && ch<= 'Z' || ch>= 'a' && ch<= 'z') | |
nl++; | |
i++; | |
} | |
printf("Letter : %d\n",nl); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment