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

How can you find the exact size of a data type in c?

952


How do we declare variables in c?

1008


What does void main () mean?

1179


What is extern variable in c with example?

950


Is that possible to add pointers to each other?

1319


Using which language Test cases are added in .ptu file of RTRT unit testing???

4217


What does dm mean sexually?

1261


Explain what are global variables and explain how do you declare them?

1086


What are the 5 types of organizational structures?

1019


Explain built-in function?

1088


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2131


How does #define work?

1011


Write a program to use switch statement.

1077


Explain how can I convert a string to a number?

1025


Why use int main instead of void main?

1072