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 program to accept a number and to print numbers in
pyramid format?
for eg:for a no. 5
1
212
32123
4321234
543212345

Answer Posted / suresh

#include <stdio.h>

int main() {
int i;
int j;
int k;

for (i = 1; i <= 5; i++) {
for (j = i; j >= 1; j--) {
printf("%d", j);
}
for (k = 2; k <= i; k++) {
printf("%d", k);
}

printf(" ");
}

printf("n");

return 0;
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism in oops with example?

1056


Which is not an object oriented programming language?

999


What is this pointer in oop?

1078


What is the purpose of polymorphism?

1128


What is pure oop?

1111


What are the two different types of polymorphism?

1147


What does it mean when someone says I oop?

1063


What is methods in oop?

982


What exactly is polymorphism?

1133


Can a destructor be called directly?

1076


Can we create object of abstract class?

1099


Why is abstraction needed?

1039


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3533


hi all..i want to know oops concepts clearly can any1 explain??

2141


What language is oop?

1013