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

write a pgm to print
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1

Answer Posted / nisrar

void main()
{
int i,j,k,m;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
for(m=i;m>1;m--)
{
printf("%d",m-1);
}
printf("\n");
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to pass an entire structure to functions?

989


What is NULL pointer?

1078


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1090


Is c still used?

1032


What is scanf () in c?

1111


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1100


In a switch statement, explain what will happen if a break statement is omitted?

1046


Discuss the function of conditional operator, size of operator and comma operator with examples.

1145


What is the difference between array and structure in c?

1146


Why isn't any of this standardized in c? Any real program has to do some of these things.

1191


What is variable and explain rules to declare variable in c?

1073


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1116


What does %2f mean in c?

1196


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1663


Should I learn c before c++?

1213