How to print India by nested loop?
I
IN
IND
INDI
INDIA
Answer Posted / ashim ghosh
#include<stdio.h>
#include<conio.h>
void main()
{
char arr[20]={"INDIA"};
int i,j;
for(i=0;i<=5-1;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",arr[j]);
}
printf("\n")
}
getch();
}
Is This Answer Correct ? | 18 Yes | 11 No |
Post New Answer View All Answers
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is identifier in c?
Do you know the use of fflush() function?
Is null valid for pointers to functions?
Compare interpreters and compilers.
How can I call fortran?
Explain what are binary trees?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is file in c language?
Why we not create function inside function.
Why we use void main in c?
How many types of errors are there in c language? Explain
What are the advantages of union?
What is #define size in c?
What is wrong with this program statement? void = 10;