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


Please Help Members By Posting Answers For Below Questions

What is setbase c++?

620


What is the use of endl?

541


What is the use of string in c++?

545


Where is atoi defined?

577


What is a virtual destructor? Explain the use of it?

543






How does a copy constructor differs from an overloaded assignment operator?

551


What is the array and initializing arrays in c++?

502


Explain the static storage classes in c++.

700


Explain class invariant.

584


What is the difference between #import and #include in c++?

592


What are c++ variables?

533


What is an associative container in c++?

542


Explain dangling pointer.

674


Is empty stack c++?

519


What is prototype in c++ with example?

559