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

What does typedef struct mean?

1163


What are the rules for the identifier?

1217


What is difference between structure and union?

1190


Do you know the difference between exit() and _exit() function in c?

1111


What is calloc()?

1132


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2283


What is class and object in c?

1175


What is the hardest programming language?

1214


What are loops c?

1102


What are global variables and explain how do you declare them?

1181


What are the properties of union in c?

1111


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1155


What is the benefit of using an enum rather than a #define constant?

1319


What is pivot in c?

1077


what is reason of your company position's in india no. 1.

2411