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

Is it legal in c++ to overload operator++ so that it decrements a value in your class?

1114


When there is a global variable and local variable with the same name, how will you access the global variable?

1159


Explain operator overloading.

1109


What is implicit pointer in c++?

1143


Can c++ be faster than c?

1079


Is there any function that can skip certain number of characters present in the input stream?

1129


What is the use of ::(scope resolution operator)?

1123


What is an iterator?

1241


Why c++ is not a pure oop language?

1094


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1132


Can we use pointers in c++?

1117


What is linked list in c++?

1177


What is a float in c++?

1032


What is c++ best used for?

1105


Is linux written in c or c++?

1089