can u show the program to read and print data of different types
Answers
Answered by
1
Answer:
#include<stdio.h>
#include <stdlib.h> // for exit() function
int main()
{
char c[1000];
FILE *fptr;
if ((fptr = fopen("studytonight.txt", "r")) == NULL)
{
printf("Error! opening file");
// exit from program if file pointer returns NULL.
exit(1);
}
// read the text until newline
fscanf(fptr,"%[^\n]", c);
printf("Data from the file:\n%s", c);
fclose(fptr);
return 0;
}
plz follow me
mark me as brainlist
Answered by
1
Answer:
refer my attachment dr.. hope it helps ☺☺☺☺..
happy learning
Attachments:
Similar questions