Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to print WORDPROCESSING as WORD PROCESSING, WORD, PROCESSING, W.P.

Posted By: Kathleen Adams     Category: C Programming     Views: 4583

Program to print WORDPROCESSING as WORD PROCESSING, WORD, PROCESSING, W.P as shown below.

INPUT
WORDPROCESSING

OUTPUT
WORD PROCESSING
WORD
PROCESSING
W.P.

Code for Program to print WORDPROCESSING as WORD PROCESSING, WORD, PROCESSING, W.P. in C Programming

#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();
}
  
Share: 



Kathleen Adams
Kathleen Adams author of Program to print WORDPROCESSING as WORD PROCESSING, WORD, PROCESSING, W.P. is from Seattle, United States.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Arron Lee from United States Comment on: Sep 17
Thans for your nice sharing. But I used to process word document using some manual tools which can be customized by the users according to their own favors.
www.rasteredge.com/.../

View All Comments