boost learn study
Tuesday, April 1, 2014
Write a Program How many Words in a File
Home
�
C File Input/Output
�
How many Words in a File
#include
#include
void main() { FILE *p; char ch; int len = 1; clrscr(); printf("Enter the Lines"); p = fopen("Student.txt","w"); while((ch=getchar()!=EOF) { putc(ch,p); } fclose(p); printf("After the Inputting"); p = fopen("Student.txt","r"); while((ch=getc(p))!EOF) { if(ch=="") { len ++; } } printf("Length of Words : %d",len); fclose(p); getch(); }
Read more �
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment