Character

Write A Program declare a character, initialize a character and print it.

Write A Program declaration cum intialization of a character and print it.

Write A Program read a character and print it.

getch():-
getch() is used to read a single character from the user without echoing and process it immediately.
Syntax:- variable=getch();


getche():-
getche() is used for reading a single character from the user with echoing and process it immediately.
Syntax:- variable=getche();

getchar():-
getchar() is used for reading a single character from the user with echoing and does not process it immediately.
Syntax:- variable=getchar();

Putch():-
For printing a character.
Syntax:- putch(variable);
Write A Program for reading and printing single character.

Putchar():-
For printing a character.
Syntax:- putchar(variable);
Write A Program for reading and printing single character.

Getc():-
accepts as parameter the reference of device and allows one character to be read from this device during program execution.
Syntax:- variable=getc(stdin);
Putc():-
For printing a character.
Syntax:- putc(variable,stdout);

Character Convertion functions:-
1) toupper() :-
This function converts a single character to upper case.
syntax:- toupper(character);
2) tolower() :-
This function converts a single character to lower case.
syntax:- tolower(character);

Single Character handling functions:-

islower(character):-only lowercase alphabetic.
isupper(character):-only uppercase alphabetic.
isalnum(character):-Only alphanumeric: any alphabetic or numeric character.
ispunct(character):- Any graphic character that is not alphanumeric.
isalpha(character):- Any alphabetic character, upper (or) lower case.
isdigit(character):- Decimal digits (0…9)
isxdigit(character):- Hexadecimal digits(0 -9,a-f,A-F)
isodigit(character):-octal digits( 0 -7)
isspace(character):- Whitespace character: space character(32), horizontal tab(9),vertical tab(11), line feed(10), vertical tab(11),form feed(12), and carriage return (13).
isgraph(character):-
Character with printable graphic; all printable characters except space.
isprint(character):- Printable character, that is character with an assigned graphic.
Iscntrl(character):- Printable character, that is character with an assigned graphic.
note:- when we are using single character handling functions we have to include a header file 

No comments:

Post a Comment