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

Define linked lists with the help of an example.

644


What is difference between class and structure in c++?

723


Differentiate between a template class and class template in c++?

713


What are namespaces in c++?

695


Are vectors passed by reference c++?

599






Describe exception handling concept with an example?

640


What is long in c++?

835


How does atoi function work?

744


What does #define mean in c++?

759


What is c++ similar to?

694


Can we make copy constructor private in c++?

717


What is scope resolution operator in c++ with example?

639


If dog is a friend of boy, is boy a friend of dog?

652


What is the full form nasa?

669


Is dev c++ a good compiler?

600