Write
a program in C to input a character from the user in lower case and print that
character into the upper case.
For this program we are going to use toupper function.
toupper function is used to convert a lower-case character into the uppercase. The
required header file for this is ctype.h (character type).
SYNTEX: -
Character
variable name = toupper (character variable )
Now let’s do program;
#include<stdio.h>
#include<ctype.h>
void main()
{
char a;
char a;
clrscr ();
printf (“\n enter the character you want to calculate “);
scanf (“%c”, & a);
a = toupper (a);
printf (“\n upper case form of input character is = %c”,
a );
getch();
}
OUTPUT: -
Enter the character =
Uppercase form of input
character is =
Comments
Post a Comment