write a c++ program that gives output
4
3 4
2 3 4
1 2 3 4 using looping statement
Answer Posted / rajesh
This answer is to print :
4
34
234
1234
#include<stdio.h>
int main()
{
int i, space, num, n=4;
for(i=1; i<=n; i++)
{
for(space=1; space<=n-i; space++)
{
printf(" ");
}
for(num=space; num<=n; num++)
{
printf("%d",num);
}
printf("\n");
}
printf("\n");
}
| Is This Answer Correct ? | 2 Yes | 9 No |
Post New Answer View All Answers
What is the fastest c++ compiler?
What is abstract keyword in c++?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Describe protected access specifiers?
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?
What is the rule of three?
Is it possible for the objects to read and write themselves?
Explain what are single and multiple inheritances in c++?
When must you use a pointer rather than a reference?
Does c++ have finally?
What is linked list in c++?
What is the role of copy constructor in copying of thrown objects?
Explain how a pointer to function can be declared in C++?
Define vptr.
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0