Wednesday, February 16, 2011

Managing Input and Output Operations

Given the string "WORDPROCESSING", write a program to read the string from the terminal and display the same in the following formats:
(a) WORD PROCESSING
(b) WORD
     PROCESSING
(c) W.P.

#include<stdio.h>
void main()
{
char name[20]="WORDPROCESSING";
clrscr();
printf("%.4s PROCESSING\n",name);
printf("%.4s\nPROCESSING\n",name);
printf("%.1s.P.",name);
getch();
}

No comments:

Post a Comment