How to print India by nested loop?
I
IN
IND
INDI
INDIA
Answer Posted / ramesh k
#include<stdio.h>
#include<conio.h>
#include<string.h>
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();
}
| Is This Answer Correct ? | 1 Yes | 12 No |
Post New Answer View All Answers
How can I read and write comma-delimited text?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Implement bit Array in C.
Why is c used in embedded systems?
Why is it important to memset a variable, immediately after allocating memory to it ?
What are the 4 types of functions?
Can math operations be performed on a void pointer?
List the different types of c tokens?
Explain the concept and use of type void.
Write a program for Overriding.
Define Array of pointers.
a program that can input number of records and can view it again the record
Explain modulus operator. What are the restrictions of a modulus operator?
What is binary tree in c?
What is a pointer on a pointer in c programming language?