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
Explain the concept and use of type void.
For what purpose null pointer used?
Where is c used?
Explain what standard functions are available to manipulate strings?
Why is this loop always executing once?
How is null defined in c?
What are the functions to open and close the file in c language?
If fflush wont work, what can I use to flush input?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What Is The Difference Between Null And Void Pointer?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
What is structure packing in c?
What is string function c?
In c programming language, how many parameters can be passed to a function ?
What is signed and unsigned?