Home » , » Basic C Programming Practice - Practice 5

Basic C Programming Practice - Practice 5

Written By Unknown on Thursday, October 10, 2013 | 11:34 PM

=> Write a program for converting the inputted uppercase letter to the lowercase letter.




Solution :

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

int main()

{
     char ch;

     scanf("%c", &ch);

     if(ch>='A' && ch <='Z') 
     

     printf("%c",ch+32); 
     
     else 
     

     printf("%c",ch);
     
     getch(); 


} 


Program Analysis :
Here ch is a character type variable,we use % c to get input character from user or terminal.+ 32 works like a converter to convert uppercase letter to lowercase.

The program says,If any uppercase number inputted by user then convert it to lowercase number otherwise print the number what user inputted because it is already lowercase character.

Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates