#include<stdio.h> #include<conio.h> void main() { FILE *fp; char ch; int not=0,nob=0,noc=0; fp=fopen("PRIME.C","r"); while(1) { ch=fgetc(fp); if(ch==EOF) break; noc++; if(ch==' ') nob++; if(ch=='\n') not++; if(ch=='\t') not++; } fclose(fp); printf("\nCharacters %d",noc); printf("\nBlanks %d",nob); printf("\nTABS %d",not); printf("\n"); fclose(fp); getch(); }
OUTPUT
0 comments:
Post a Comment
Please add only useful comments.......