Question { Wipro, 16427 }
How to print India by nested loop?
I
IN
IND
INDI
INDIA
Answer
#include
#include
#include
void main()
{
char name[20];
int a;
clrscr();
printf("enter the INDIA name");
scanf("%c",&name);
a=strlen(name);
for(int i=0;i<=a;i++)
{
for(int j=0;j<=i;j++)
{
printf("%c",name[i]);
}
printf("\n");
}
getch();
}