C examples for Data Type:char
getch() does not echo the character to the screen.
The getche( ) function is the same as getch( ), but the key is echoed.
#include <stdio.h> #include <conio.h> #include <ctype.h> int main(void) { char ch;/*ww w .j ava 2 s. com*/ printf("Enter some text (type a period to quit).\n"); do { ch = getch(); if (islower(ch)) ch = toupper(ch); else ch = tolower(ch); putchar(ch); } while (ch != '.'); return 0; }