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
Why is polymorphism useful?
What is c++ in english?
How do you establish an is-a relationship?
What do you mean by stack unwinding in c++?
What is a singleton class c++?
What does n mean in c++?
Is rust better than c++?
When should we use multiple inheritance?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
Why c++ does not have finally?
How do you show the declaration of a virtual constructor?
Is it possible to get the source code back from binary file?
Explain the term memory alignment?
What is rvalue?
How is data hiding achieved in c++?