fork download
  1. #include<stdio.h>
  2. void main()
  3. {
  4. int ch;
  5. printf("Running getch(), please enter a character: ");
  6. /*Does not echo pressed char key on the screen*/
  7. printf("\n");
  8. ch = getchar();
  9. /* getch() does not echo pressed char key on the screen*/
  10. printf("\n");
  11. printf("The character value you have just entered: %c", ch);
  12. printf("\n");
  13. printf("Running getche(), please enter a character: ");
  14. ch= getchar();
  15. /*getche() does echo the pressed character key on the screen*/
  16. printf("\n");
  17. printf("The character value you have just entered: %c", ch);
  18. printf("Running getchar(), please enter a character: ");
  19. ch = getchar();
  20. printf("The character value you have just entered: %c", ch);
  21. }
Success #stdin #stdout 0.03s 25888KB
stdin
Standard input is empty
stdout
#include<stdio.h>
void main()
{
int ch;
printf("Running getch(), please enter a character: ");
/*Does not echo pressed char key on the screen*/
printf("\n");
ch = getchar();
/* getch() does not echo pressed char key on the screen*/
printf("\n");
printf("The character value you have just entered: %c", ch); 
printf("\n");
printf("Running getche(), please enter a character: ");
ch= getchar();
/*getche() does echo the pressed character key on the screen*/
printf("\n");
printf("The character value you have just entered: %c", ch);
printf("Running getchar(), please enter a character: "); 
ch = getchar();
printf("The character value you have just entered: %c", ch);
}