Program to print WORDPROCESSING as WORD PROCESSING, WORD, PROCESSING, W.P as shown below. INPUT WORDPROCESSING OUTPUT WORD PROCESSING WORD PROCESSING W.P.
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[14]; int i; clrscr(); printf("Enter the String:-"); scanf("%s",str); for(i=0;i<14;i++) { if(i==4) printf(" "); printf("%c",str[i]); } printf("\n"); for(i=0;i<14;i++) { if(i==4) printf("\n"); printf("%c",str[i]); } printf("\n"); for(i=0;i<14;i++) { if(i==0 || i==4) printf("%c",str[i]); if(i==1) printf("."); } printf("\n"); getch(); }