Convert a character in upper case to lower case and vice versa

Program to convert a character in upper case to lower case and vice versa

  • QUESTION DESCRIPTION
    Write 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 
    INPUT
    P
    OUTPUT

    p
           TEST CASE 2
            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;
}





1 comment:

Featured post

Introduction to my blog

INTRODUCTION  TO  MY  BLOG Hello , That was my first blog so I did not know how to start writing my first blog post. So here goes ,...