86 : C Program to read sentence in uppercase and print in lowercase

Check out the complete list of c-programs : C Program List    












/*
 * 1000+ C programs + tutorials
 *
 * 
 * 87_c_program_to_read_sentence_in_and_swap_uppercases_lowercases.c
 *  
 *  
 *
 *  Created on: Oct 25, 2014
 *  Author: Code2care.org
 */

#include 
//#include 

void main() {

char ch;

//clrscr();

printf("Enter a String : ");

while( (ch=getchar( )) !='\n')  {
    
    if(ch>=65 && ch<=90) {
        putchar(ch+32);
     }
     else if(ch>=97 && ch<=122) {
    putchar(ch-32);
    }
    else {
        putchar(ch);
    }



}

//getch();  
   
}









The best way to learn C programming is to practice more and more of programs . Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.