28) Sample C Program to accept a string and print it by using the while loop. # include <stdio.h> # include <conio.h> main( ) { char ch; clrscr(); printf("Enter a string:"); while(( ch = getchar() ) != '\n') putchar(ch); getch(); } 29) Sample C Program to accept a string in upper case and print it in lower case. # include <stdio.h> # include <conio.h> main( ) { char ch,c; clrscr(); printf("Enter a string in upper case:"); while(( ch = getchar( ) ) != '\n') { c = ch + 32; putchar(c); } printf(" :String In Lower Case"); getch( ); } 30) Sample 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 ...
All HR and Technical interview questions with answers for freshers and experienced professional. It helps job seekers who are about to attend interviews.