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 :
4342341234

#include<stdio.h>

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

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

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are function pointers?

979


What is atoi in c++?

1017


Explain function overloading

963


What is namespace & why it is used in c++?

1041


Declare a class vehicle and make it an abstract data type.

925


What is an associative container in c++?

1009


Is map thread safe c++?

1025


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

1052


Explain polymorphism?

1032


What is protected inheritance?

1010


What is buffering in c++?

1022


Do the parentheses after the type name make a difference with new?

1038


How we can differentiate between a pre and post increment operators during overloading?

1042


What's the order in which the local objects are destructed?

1203


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1445