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 c++ still popular?

1042


What's the most powerful programming language?

1038


What is format for defining a structure?

1079


How a modifier is similar to mutator?

1177


What is an adjust field format flag?

1110


What is the best book for c++ beginners?

1040


What is a pointer how and when is it used?

1092


What is c++ and its features?

1013


What is polymorphism in c++? Explain with an example?

1034


Can a program run without main function?

1157


What is a dynamic binding in c++?

953


Where must the declaration of a friend function appear?

959


What is pure virtual function?

1061


How to declare an array of pointers to integer?

1139


What is a catch statement?

1045