Answer to Question #304331 in C for harikarthick

Question #304331

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

1
Expert's answer
2022-03-02T14:10:15-0500
#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;
}

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