Program to convert a character in upper case to lower case and vice versa
- QUESTION DESCRIPTIONWrite a program to read a character in upper case and then print it in lower case
Input and Output Format:
Refer sample input and output for formatting specification.
All float values are displayed correct to 2 decimal places.
All text in bold corresponds to input and the rest corresponds to output. - TEST CASE 1 INPUTPOUTPUT
p
TEST CASE 2
c
INPUT
C
OUTPUT
c
- CODING
#include <stdio.h>
int main()
{
char c;
scanf("%c",&c);
if(c>='a'&& c<='z')
c=c-32;
else
c=c+32;
printf("%c",c);
return 0;
}
int main()
{
char c;
scanf("%c",&c);
if(c>='a'&& c<='z')
c=c-32;
else
c=c+32;
printf("%c",c);
return 0;
}
not exurcted
ReplyDelete