Computer Science, asked by starbhalla565, 11 months ago

WAP to write INDIA like
I
IN
IND
INDI
INDIA
IN PYTHON

Answers

Answered by vimalraj1217
0

Answer:

void main()

{

char a[20];

int i,j,k;

clrscr();

gets(a);

j=strlen(a);

i=0;

while(i<j)

{

for(k=0;k<=i;k++)

{

printf("%c",a[k]);

}

printf("\n");

i++;

}

}

//APPLICABLE FOR ANY STRING

Answered by Oreki
2

word = 'INDIA'

print(*[word[:i] for i in range(1, len(word) + 1)], sep = '\n')

Similar questions