Computer Science, asked by prathyushayenugonda, 5 months ago

can u show the program to read and print data of different types

Answers

Answered by dangiadarsh6266
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 sneha070204
1

Answer:

refer my attachment dr.. hope it helps ..

happy learning

Attachments:
Similar questions