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: 6789

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].

 
No Comment Found, Be the First to post comment!