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 c++ called oops? Explain
Specify different types of decision control statements?
What is cin clear () in c++?
Where the memory to the static variables is allocated?
Should the this pointer can be used in the constructor?
Is c++ harder than java?
What is abstraction in c++?
what are the types of Member Functions?
Can we inherit constructor in c++?
Why we use #include conio h in c++?
Can you write a function similar to printf()?
Is c++ an oop?
Program to check whether a word is a sub-string or not of a string typed
What is late binding c++?
What can I use instead of namespace std?