#include<stdio.h> void main() { int nwords[20]; int count=0, i, c; for(i=0;i<20;i++) { nwords[i]=0; } while((c=getchar())!='\n') { while((c!=' ')||(c!='\t')) { nwords[count]++; c=getchar(); } count++; } for(i=0;i<20;i++) { printf("word no. %d : %d letters", (i+1), nwords[i]); } }
c==' '
c=='\t'
c!='\t'
true
c!=' ' && c!='\t'
while(c!=' ' && c!='\t')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)