#include <stdio.h>
#include <conio.h>
void main(void)
{
FILE *fp;
int num;
clrscr();
printf("Program on Reading of a File of Integers\n");
fp = fopen("three.dat","r");
if (fp == NULL)
{
printf("File Opening Error\n");
exit(0);
}
printf("\nThe available integers are : ");
while ((num=getw(fp)) != EOF)
printf("%d ",num);
fclose(fp);
printf("\nPress any key to end...");
getch();
}
#include <conio.h>
void main(void)
{
FILE *fp;
int num;
clrscr();
printf("Program on Reading of a File of Integers\n");
fp = fopen("three.dat","r");
if (fp == NULL)
{
printf("File Opening Error\n");
exit(0);
}
printf("\nThe available integers are : ");
while ((num=getw(fp)) != EOF)
printf("%d ",num);
fclose(fp);
printf("\nPress any key to end...");
getch();
}
No comments:
Post a Comment