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

Can a function take variable length arguments, if yes, how?

1073


daily Routine of father

1459


What is the extension of c++?

1027


Show the application of a dynamic array with the help of an example.

1196


What do you mean by function pointer?

1167


What does obj stand for?

1256


Differentiate between an inspector and a mutator ?

1293


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

1217


write a function signature with various number of parameters.

1102


Why is c++ considered difficult?

1224


What is c++ mutable?

1166


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

2408


Is atoi safe?

1096


How the endl and setw manipulator works?

1057


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

3704