Answers for "getchar putchar stdin stdout C"

C
0

getchar putchar stdin stdout C

/**
* USING getchar() and putchar()
* getchar(): takes input from stdin a char at a time
* putchar(): displays output at stdout a char at a time
*/

// This program gets int c from the user(stdin) and returns it back to the terminal (stdout)
#include <stdio.h>
int main( ) {

   int c;

   printf( "Enter a value :");
   c = getchar( );

   printf( "\nYou entered: ");
   putchar( c );

   return 0;
}
Posted by: Guest on August-09-2021

Code answers related to "C"

Browse Popular Code Answers by Language