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 | 12 No |
Post New Answer View All Answers
Define Array of pointers.
What is %lu in c?
How do you determine whether to use a stream function or a low-level function?
What does s c mean on snapchat?
What is page thrashing?
Implement bit Array in C.
How many main () function we can have in a project?
code for find determinent of amatrix
Why main is used in c?
Why are all header files not declared in every c program?
What is the best organizational structure?
What does malloc () calloc () realloc () free () do?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is oops c?
Explain the difference between malloc() and calloc() function?