Answer to Question #301529 in C for Siva

Question #301529

Write a C program for File Operations to read a string from standard input and prints the entered string using fgets() and fputs() function.


Runtime Input :


Hai


Output :


Hai

1
Expert's answer
2022-02-23T12:18:57-0500
#include<stdio.h>  
#include<conio.h>  
void main() {
	FILE* fp;
	char text[300];
	fp = fopen("myfile2.txt", "w");
	fputs("hello c programming", fp);
	printf("%s", fgets(text, 200, fp));


	fclose(fp);
	getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS