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

Why is polymorphism useful?

1021


What is c++ in english?

999


How do you establish an is-a relationship?

1080


What do you mean by stack unwinding in c++?

1183


What is a singleton class c++?

969


What does n mean in c++?

1076


Is rust better than c++?

1063


When should we use multiple inheritance?

993


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

3595


Why c++ does not have finally?

1023


How do you show the declaration of a virtual constructor?

903


Is it possible to get the source code back from binary file?

1291


Explain the term memory alignment?

1163


What is rvalue?

1087


How is data hiding achieved in c++?

1029