Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

When should a far pointer be used?

1136


What is calloc malloc realloc in c?

1063


What are the types of unary operators?

1192


What is assignment operator?

1061


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1096


can we implement multi-threads in c.

1134


What are variables c?

1055


What does void main return?

1129


What is a example of a variable?

1027


Difference between pass by reference and pass by value?

1164


What is indirection?

1098


How many bytes is a struct in c?

1173


Why do we need a structure?

1046


Describe the header file and its usage in c programming?

1072


What is function prototype in c with example?

1093