Program to convert a lower case character into upper case and again to lower case


Program to convert a lower case character into upper case and again to lower case


#include <stdio.h>
#include <conio.h>

void main()
{
char ch;

clrscr();


printf("Enter a character : ");
scanf("%c",&ch);

printf("\nYou entered : %c",ch);

ch = toupper(ch); //toupper() function converts a lower case letter to upper case


printf("\n\nAfter converting to upper case : %c",ch);

//tolower() function converts a upper case letter to lower case

printf("\n\nAfter converting again to lower case : %c",tolower(ch));

getch();
}

Output :


0 comments:

Post a Comment