Completely Solved C, C++ Programs Assignment.




C Program to accept a string in any case and print it by another case .

Filed Under:

Problem 30. C Program to accept a string in any case and print it by another case .
#include<stdio.h>
#include<conio.h>
main( )
{
char ch;
clrscr( );
printf(“enter a string :”);
while(( ch=getchar( ))!=’n’)
{
if(ch>=’A’ && ch<=’Z’)
putchar(ch+32);
else
if(ch>=’a’ && ch<=’z’)
putchar(ch-32);
else
putchar(ch);
}
printf(“ is the string”);
getch( );
}

C compiler: gcc 4.1.2

  Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments