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 abstraction and encapsulation?

945


Why polymorphism is used in oops?

998


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

2050


What is oops?what is its use in software engineering?

979


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

6427


Can a destructor be called directly?

1021


Write a program to sort the number with different sorts in one program ??

2325


How oops is better than procedural?

1030


Where is pseudocode used?

1033


Why do we use polymorphism?

1014


What is pointer in oop?

971


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

2080


Can bst contain duplicates?

1145


What are the 3 pillars of oop?

1101


2. Give the different notations for the class.\

2086