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 without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;

Answer Posted / shubham gupta

#include<stdio.h>
void fun(int n)
{
static int i=1,j;
printf("%d\n",i);
(100-i)?(i++?fun(n):0):exit(0);

}
int main()
{
int n;
n=100;
fun(n);
}

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are structural members?

1004


Explain the advantages and disadvantages of macros.

1096


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2374


What will be the outcome of the following conditional statement if the value of variable s is 10?

1284


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1691


What is function prototype?

1132


Explain what is the heap?

1052


Why doesnt the call scanf work?

1189


Explain what is the difference between the expression '++a' and 'a++'?

1212


Explain argument and its types.

1058


How can you determine the maximum value that a numeric variable can hold?

1228


How will you delete a node in DLL?

1284


Explain goto?

1150


What are the advantages of using new operator as compared to the function malloc ()?

1329


What are preprocessor directives in c?

1092