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 multilevel inheritance?

1150


What is object and example?

1112


What is stream in oop?

1245


explain sub-type and sub class? atleast u have differ it into 4 points?

2255


What are the types of abstraction?

992


What are the 4 pillars of oop?

1086


What causes polymorphism?

1065


What is purpose of inheritance?

1048


Whats oop mean?

988


What is polymorphism what are the different types of polymorphism?

946


what is the drawback of classical methods in oops?

3315


How to improve object oriented design skills?

945


What is destructor oops?

1027


to find out the minimum of two integer number of two different classes using friend function

2074


How to call a non virtual function in the derived class by using base class pointer

6418