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...

1
1 2
1 2 3
1 2 3 4
1 2 3
1 2
1
generate this output using for loop

Answer Posted / varsha shukla

#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,k,l;
for(i=1;i<=4;i++)
{
for(k=i;k<=4;k++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf(" %d",j);
}
printf("\n");
}
for(i=3;i>0;i--)
{
for(l=i;l<=3;l++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf(" %d",j);
}
printf("\n");
}
getch();

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pointers in C? Give an example where to illustrate their significance.

1275


Difference between malloc() and calloc() function?

1271


What is the difference between call by value and call by reference in c?

1215


Can a local variable be volatile in c?

1056


I have a varargs function which accepts a float parameter?

1099


Differentiate between static and dynamic modeling.

1188


Explain what are header files and explain what are its uses in c programming?

1204


What is c++ used for today?

1155


What is use of null pointer in c?

1060


Explain how do you sort filenames in a directory?

1077


Tell us bitwise shift operators?

1147


What is the condition that is applied with ?: Operator?

1186


What is use of integral promotions in c?

1208


What is sorting in c plus plus?

1026


What is the difference between text files and binary files?

1400