Monday, July 2, 2018

C program to count number of letters in a word

#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;
}

No comments:

Post a Comment

Derivatives stock list at NSE

Complete FNO stock list at NSE. ABB India Ltd ACC Ltd APL Apollo Tubes Ltd AU Small Finance Bank Ltd Aarti Industries Ltd Abbott India Ltd A...