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 is the difference between struct and typedef struct in c?

1171


How variables are declared in c?

1100


What is int main () in c?

1127


Explain the difference between exit() and _exit() function?

1213


What is structure in c language?

1237


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1170


What is the general form of function in c?

1071


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

2007


How do I create a directory? How do I remove a directory (and its contents)?

1222


What are the types of assignment statements?

1111


What is meant by inheritance?

1152


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1088


What are the 5 elements of structure?

1129


Why is not a pointer null after calling free?

1073


Differentiate Source Codes from Object Codes

1662