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 I learn c++ without c?
What are arrays c++?
What problems might the following macro bring to the application?
What is the header file for setw?
Why pointer is used in c++?
What do you mean by enumerated data type?
What is the difference between global int and static int declaration?
What c++ library is string in?
What is an adjust field format flag?
Show the declaration for a static function pointer.
What is vector processing?
What are 2 ways of exporting a function from a dll?
What is function overriding in c++?
Why do we use the using declaration?
Define the process of handling in case of destructor failure?