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 write a function analogous to scanf?

1103


what are the different storage classes in c?

1122


Do pointers store the address of value or the actual value of a variable?

1022


Explain the difference between null pointer and void pointer.

1034


What is meant by keywords in c?

1038


What is keyword with example?

1015


What are the advantages and disadvantages of pointers?

1015


What are loops c?

998


What is 02d in c?

1030


How can I recover the file name given an open stream?

950


Tell us something about keyword 'auto'.

1013


What is extern variable in c with example?

954


What are the features of the c language?

1038


Is c procedural or object oriented?

956


Is c is a middle level language?

1015