Computer Science, asked by meet90, 11 months ago

I
IN
IND
INDI
INDIA

Complete the program using java language


garywalter1221: same question I also asked but in C language
garywalter1221: I can make this in C langage
garywalter1221: means C language

Answers

Answered by AbhijithPrakash
1

Input

  1. #include<stdio.h>
  2. void main()
  3. {
  4.    int x,y;
  5.    char str[]="INDIA";
  6.     for(x=0 ; x<5 ; x++)
  7.     {
  8.            y=x+1;
  9.            printf("%-5.*s\n",y,str);
  10.     }
  11.     for(x=4; x>=0; x--)
  12.     {
  13.            y=x+1;
  14.            printf("%-5.*s\n",y,str);
  15.     }
  16. }


Hope this will work...



The output will be:

I

IN

IND

INDI

INDIA

INDIA

INDI

IND

IN

I

Similar questions