write a c++ program that gives output
4
3 4
2 3 4
1 2 3 4 using looping statement

Answer Posted / rajesh

4
3 4
2 3 4
1 2 3 4

#include<stdio.h>

int main()
{
int i, j, n=4;

for(i=n; i>=1; i--)
{
for(j=i; j<=n; j++)
{
printf("%d",j);
}
printf("\n");
}
printf("\n");
}

Is This Answer Correct ?    32 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the error in the code below and how should it be corrected?

389


What are the advantages of using a pointer?

693


What are structs in c++?

676


Can you sort a set c++?

619


What are features of c++?

742






Explain linked list using c++ with an example?

717


What is endl c++?

702


What is an object in c++?

695


What is the use of seekg in c++?

691


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

691


What is the difference between object-oriented programming and procedural programming?

788


Where are setjmp and longjmp used in c++?

722


What are friend classes?

713


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

646


Explain how to initialize a const member data.

679