#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp; /* file pointer*/
char ch;
clrscr();
fp=fopen("k.txt","r");/*open a file*/
while((ch=fgetc(fp))!=EOF)
{
printf("%c",ch);
}
fclose(fp);
if(fp==NULL)
{
fp=fopen("k.txt","w");
}
getch();
}
(adsbygoogle = window.adsbygoogle...
C++ Program .Write a program to open file for reading & display it's content on the screen.
By Sachin
February 26, 2014
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp; /* file pointer*/
char ch;
clrscr();
fp=fopen("b.txt","r");/*open a file*/
if(fp==NULL)
{
printf("\n unable to open file");
}
while((ch=fgetc(fp))!=EOF)
{
printf("%c",ch);
}
fclose(fp);
getch();
}
(adsbygoogle = window.adsbygoogle || []).push({}...
FYBCA ( Sem–II) Assignment No.6 Structure program.(solved assignment)
By Unknown
February 25, 2014
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
...