Why does the following snippet closes after the first input?:
#include <stdio.h>
int main( ) {
int a;
int b;
printf( "Enter a first value :");
a = getchar( );
printf( "You entered: ");
putchar( a );
printf( "\n Enter a second value :");
b = getchar( );
return 0;
}
The program closes after printing
"Enter a second value :"