#include<stdio.h>
int main(){
int count=0,i=0;
printf("Type a word ");
char word[50];
scanf("%s",&word);
printf("\nYou typed the word \'%s\' \n",word);
while(word[i]!='\0'){
count++;
i++;
}
printf("\nTotal number of letters in %s are %d\n",word,count);
return 0;
}
int main(){
int count=0,i=0;
printf("Type a word ");
char word[50];
scanf("%s",&word);
printf("\nYou typed the word \'%s\' \n",word);
while(word[i]!='\0'){
count++;
i++;
}
printf("\nTotal number of letters in %s are %d\n",word,count);
return 0;
}
No comments:
Post a Comment