Character in C Language
Character:= C provides some built-in functions to perform operations on a character. To use the character function in a program the header file <ctype.h> must be included in the program.
Character Input Output:=
1) scanf("%c",char_Identifier);
2) getcharactor(char_Identifier);
1) printf("%c",char_identifier[i]);
2) putcharactor(char_Identifier);
Character functions:= Character functions accept a character variable or a character contact as an argument.
charfunc(character_variable);
charfunc('character_variable’);
1) toupper()
2) tolower()
3) isalpha()
4) isdigit()
Write a program to find the given character is upper or lower case?
#include<stdio.h>
#include<ctype.h>
main()
{
char letters;
letters=getchar();
if(islower(letters))
putchar(toupper(letters));
else
putchar(tolower(letters));
}
Comments
Post a Comment