Computer Science, asked by Anonymous, 1 month ago

Write a program to read data from the keyboard, write it to a file called INPUT, again read the same data from the INPUT file, and display it on the screen.​

.•♫•♬• ❤HOW ARE YOU GUY'S ❤•♬•♫•.​

Attachments:

Answers

Answered by Anonymous
3

Answer:

This is what I've so far. I want the program to read data from the keyboard write it to a file called INPUT, again read the same data from the INPUT file, and copy to that another file and also display it on the screen. I don't know where did I go wrong. Please help me. Thanks in advance.

#include<stdio.h>

#include<file.h>

main(){

FILE *f1,*f2;

char c;

printf(“data input\n\n”)

f1 = fopen(“INPUT”, “w”);

while((c = getchar())!=EOF)

putc(c,f1);

fclose(f1);

printf(“\ndata output\n\n”)

f1 = fopen(“INPUT”, “r”);

while((c = getchar())!=EOF)

putc(“%c”,c);

fclose(f1);

//copying f f1 data into f2

f1=fopen(file1,”r”)

if(f1=NULL)

printf(“no data”);

exit(0):

f2=fopen(file2,”w”);

if(f2=null)

printf(“cannot able to open”);

exit(0);

while((ch==getc(f1)!=EOF)

putc(ch,f2);

printf(“completed”);

fclose(f1);

fclose(f2);

Be happy ☺️☺️☺️

l hope it will help u ☺️☺️☺️

Attachments:
Answered by Anonymous
3

Answer:

꧁P꧁R꧁I꧁N꧁C꧁E꧂

Explanation:

  • Write a program to read data from the keyboard, write it to a file called INPUT, again read the same data from the INPUT file, and display it on the screen.....
Similar questions