#include<stdio.h>
#include<conio.h>
main()
{
FILE*fp1;
char ch;
int noc,nol,not,nos;
nol=noc=not=nos=0;
clrscr();
fp1=fopen("sunil.c","r");
if(fp1==NULL)
{
printf("file not found....");
}
else
{
while(!feof(fp1));
{
ch=fgetch(fp1);
if(ch==32)
{
nos++;
}
if(ch=='\t')
{
not++;
}
noc++;
}
}
printf("no of charters====>%d\n",noc);
printf("no of lines =======>%d\n",nol);
printf("no of tabs==========>%d\n",not);
printf("no of spaces========>%d\n",nos);
getch();
fcloseall();
}�
No comments:
Post a Comment