Sunday 21 January 2018

Program for Open


Program for Open
#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();
}�

0 comments:

Post a Comment