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 / akshaya

#include <iostream.h>
#include<conio.h>
void main()
{
int i,n,j;
clrscr();
cout<<"
Enter the value of n:";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
cout<<" ";
}
}
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oops in programming?

570


How do you achieve polymorphism?

618


Templates mean

1592


Can enum be null?

590


What is destructor in oop?

627






Is oop better than procedural?

576


What is the diamond problem in inheritance?

579


What are the data types in oop?

608


What is the example of polymorphism?

562


What is polymorphism oop?

623


Describe these concepts: Polymorphism, Inheritance and Abstraction.

616


Which type does string inherit from?

618


What is abstraction in oops with example?

778


What is the significance of classes in oop?

590


Which language is not a true object oriented programming language?

646