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 global variables and how do you declare them?

1074


What does it mean when a pointer is used in an if statement?

1092


Is c weakly typed?

1010


Why void is used in c?

1004


What is the use of header?

1078


When is the “void” keyword used in a function?

1484


What are the standard predefined macros?

1126


Explain what will the preprocessor do for a program?

1050


What are directives in c?

950


Can we declare a function inside a function in c?

1024


What are the main characteristics of c language describe the structure of ac program?

1200


Explain the difference between malloc() and calloc() in c?

1035


What are enums in c?

1184


what are enumerations in C

1143


What is return type in c?

1120