How to write a C Program Character in C Programming Language ?
Solution For C Program :
/*C Program Character.*/
#include <stdio.h>
#include <ctype.h>
int main(){
char a;
// Type the characters
// (1) a = getchar();
// (2)
scanf("%c", &a);
/*
(1)
if( a >= 'a' && a <= 'z' ){
a -= ('a'-'A'); // a -= 32;
}
(2)
if( islower(a) ){
a -= ('a'-'A'); // a -= 32;
}
(3)
*/
a = toupper(a);
// Output character
// (1) putchar(a);
// (2)
printf("%c", a);
return 0;
}
Another Example of Character Using C :
#include <stdio.h>
int main(){
char c;
// c = getchar();
scanf("%c", &c);
//putchar(c);
printf("%c", c);
// printf("%d", c);
return 0;
}