Write a C program for File Operations to get a character from the keyboard and print the entered character using fgetchar() and fputchar() function.
Runtime Input :
a
Output :
a
#include <stdio.h>
int main() {
// For getting input from input.txt file
freopen("input.txt", "r", stdin);
// Printing the Output to output.txt file
freopen("output.txt", "w", stdout);
return fputchar(fgetchar()), 0;
}
Comments
Leave a comment