Header Ads

How to write string "INDIAN" in following style

______________________________________Program_________________________________________

#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
    int i,j;
    char str[]="INDIAN";
    for(i=0;i<=5;i++)
    {
        j=i+1;
        printf("%.*s\n",j,str);
    }
    for(i=5;i>0;i--)
    {
        printf("%.*s\n",i,str);
    }
    getch();
}

______________________________________Output______________________________________________


output for above program

No comments