 
#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++)
 {
  ;
 }
 
 sentence[i]='\0';
 
 count = i; /*shows the number of chars accepted in a sentence*/
 
 printf("The given sentence is   : %s",sentence);
 
 printf("\nCase changed sentence is: ");
 for(i=0; i < count; i++)
 {
  ch = islower(sentence[i]) ? toupper(sentence[i]) : tolower(sentence[i]);
  putchar(ch);
 }
 
} /*End of main()*/