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++ called oops? Explain

1054


Specify different types of decision control statements?

859


What is cin clear () in c++?

1234


Where the memory to the static variables is allocated?

1063


Should the this pointer can be used in the constructor?

1032


Is c++ harder than java?

1078


What is abstraction in c++?

1363


what are the types of Member Functions?

1131


Can we inherit constructor in c++?

1101


Why we use #include conio h in c++?

1056


Can you write a function similar to printf()?

1137


Is c++ an oop?

1106


Program to check whether a word is a sub-string or not of a string typed

2042


What is late binding c++?

993


What can I use instead of namespace std?

1162