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 :
4
34
234
1234

#include<stdio.h>

int main()
{
int i, space, num, n=4;

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

Is This Answer Correct ?    2 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the fastest c++ compiler?

1054


What is abstract keyword in c++?

1038


A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

3633


Describe protected access specifiers?

1167


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

1051


What is the rule of three?

963


Is it possible for the objects to read and write themselves?

1069


Explain what are single and multiple inheritances in c++?

989


When must you use a pointer rather than a reference?

1012


Does c++ have finally?

977


What is linked list in c++?

1106


What is the role of copy constructor in copying of thrown objects?

1022


Explain how a pointer to function can be declared in C++?

1015


Define vptr.

1002


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

921