31) Sample C Program to accept a string and print each word in new line. # include <stdio.h> # include <conio.h> main( ) { char ch; clrscr( ); printf("Enter a string :"); while( ( ch = getchar( ) ) != '\n') { putchar(ch); if(ch == ' ') printf("\n"); } getch( ); } 32) Sample C Program to accept a string and count no of capital letters, no. of small letters and no. of special characters. # include <stdio.h> # include <conio.h> main( ) { char ch; int c = 0,s = 0,s1 = 0; clrscr( ); printf("Enter a string :"); while( ( ch = getchar( ) ) != '\n') { if(ch >= 'A' && ch >= 'Z') c = c + 1; else if(ch >= 'a' && ch >= 'z') s = s + 1; else s1 = s1 + 1; } printf("No. of capital letters are %d", c); printf("No. of small letters are %d", s); printf("N...
All HR and Technical interview questions with answers for freshers and experienced professional. It helps job seekers who are about to attend interviews.