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 :
4342341234
#include<stdio.h>
int main()
{
int i, space, num, n=4;
for(i=1; i<=n; i++)
{
for(space=1; space<=n-i; space++)
{
}
for(num=space; num<=n; num++)
{
printf("%d",num);
}
}
printf("\n");
}
Is This Answer Correct ? | 13 Yes | 3 No |
Post New Answer View All Answers
Define linked lists with the help of an example.
What is difference between class and structure in c++?
Differentiate between a template class and class template in c++?
What are namespaces in c++?
Are vectors passed by reference c++?
Describe exception handling concept with an example?
What is long in c++?
How does atoi function work?
What does #define mean in c++?
What is c++ similar to?
Can we make copy constructor private in c++?
What is scope resolution operator in c++ with example?
If dog is a friend of boy, is boy a friend of dog?
What is the full form nasa?
Is dev c++ a good compiler?