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
Can a function take variable length arguments, if yes, how?
daily Routine of father
What is the extension of c++?
Show the application of a dynamic array with the help of an example.
What do you mean by function pointer?
What does obj stand for?
Differentiate between an inspector and a mutator ?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
write a function signature with various number of parameters.
Why is c++ considered difficult?
What is c++ mutable?
declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator
Is atoi safe?
How the endl and setw manipulator works?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?