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 / chavidi

void main()
{
char a[20];
int i,j,k;
clrscr();
gets(a);
j=strlen(a);
i=0;
while(i<j)
{
for(k=0;k<=i;k++)
{
printf("%c",a[k]);
}
printf("\n");
i++;
}
}
//APPLICABLE FOR ANY STRING

Is This Answer Correct ?    19 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can I convert a string to a number?

1090


Do you have any idea about the use of "auto" keyword?

1095


How can type-insensitive macros be created?

1175


why we wont use '&' sing in aceesing the string using scanf

2377


Differentiate between ordinary variable and pointer in c.

1194


What is main return c?

1007


How many parameters should a function have?

1200


Explain what is the stack?

1111


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1070


Explain union.

1182


Is a house a shell structure?

1171


What are header files and what are its uses in C programming?

1249


main() { printf("hello"); fork(); }

1207


How do you construct an increment statement or decrement statement in C?

1243


What are the application of c?

1105