Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 a singleton c++?

1016


What is a dangling pointer in c++?

1166


Is overriding possible in c++?

1025


What is meant by entry controlled loop? What all C++ loops are exit controlled?

1105


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1064


List the special characteristics of constructor.

1185


What is the operator in c++?

1142


Write my own zero-argument manipulator that should work same as hex?

1062


What is function prototyping? What are its advantages?

1099


How a modifier is similar to mutator?

1193


What is fflush c++?

1037


What are static type checking?

1065


Is c++ fully object oriented?

981


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

1064


Can I learn c++ as my first language?

1123