//Downloaded From theonlinetutorials.com
//C Program to convert the lower case letters to upper case and vice-versa
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
void main()
{
char sentence[100];
int count, ch, i;
clrscr();
printf("Enter a sentence\n");
for(i=0; (sentence[i] = getchar())!='\n'; i++)
{
;
}
count = i;
printf("\nInput sentence is : %s ",sentence);
printf("\nResultant sentence is : ");
for(i=0; i < count; i++)
{
ch = islower(sentence[i]) ? toupper(sentence[i]) : tolower(sentence[i]);
putchar(ch);
}
} /*End of main()
/*-----------------------------------------
Output
Enter a sentence
gOOD mORNING
Input sentence is : gOOD mORNING
Resultant sentence is :Good Morning
------------------------------------------*/
Not Satisfied ? Just search & get the result
Related posts:
- C program to read an English sentence and replace lowercase characters by uppercase and vice-versa. Output the given sentence as well as the case converted sentence on two different lines.
- C program read a sentence and count the number of number of vowels and consonants in the given sentence. Output the results on two lines with suitable headings
- Sample – Program to convert temperatures from Celsius to Fahrenheit and vice versa.
- C program to generate and print first N FIBONACCI numbers
- C program to accept a string and find the sum of all digits present in the string
