what is the Output of the following Program?
#include “stdio.h”
void main(void)
void main(void)
{
printf("\t
%d ",getche());
getch();
}
ANSWER: it will return the Equivalent ASCII decimal
value of entered character..
getchar() Function |
getch(), getche(),
getchar() will return integer value.
getchar() returns the Equivalent
decimal(ASCII) value of entered character with echoing the entered character.
getche() returns the Equivalent
decimal(ASCII) value of entered character with echoing the entered character.
getch() returns the Equivalent
decimal(ASCII) value of entered character without echoing the entered character.
Note: Here getchar() is ASCII C Standard Function.
getche() and getch() functions are non-standard functions. so this program may
not be compiled successfully in many Platforms.. This can be compiled
successfully in VC++ and Turbo C/C++ compilers...
Click here for
more C Faq