if ( ch = =EOF)
break;
c++;
if ( ch = =’ ‘ )
s++;
if ( ch = =’\t‘ )
t++;
if ( ch = =’\n‘ )
l++;
}
fclose(fp);
printf(“\n Number of characters = %d”, c);
printf(“\n Number of blank spaces = %d”, s);
printf(“\n Number of tabs = %d”, t);
printf(“\n Number of lines = %d”, l);
getch( );
}
Example
6: Write a C program to copy the content of one file into another file on a character-
Do'stlaringiz bilan baham: