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 program that will ask the user to enter a number n and
display the product of all numbers from 1 to n.



write a program that will ask the user to enter a number n and display the product of all numbers ..

Answer / anubhavtiwari87

#include<stdio.h>
#include<conio.h>
void main()
{
int n,result;
result=1;
clrscr();
printf("enter the number");
scanf("%d",&n);
for(int i=n;i>=1;i--)
{
result=result*i;
}
printf("the desired result = %d",result);
}

Is This Answer Correct ?    8 Yes 10 No

Post New Answer

More J2SE Code Interview Questions

write a program in java to find the moving average of all prime numbers between 2 and 100.

0 Answers  


How can we get the details for printing the employee details at run time using JDBC connectivity? can u provide the coding for that? Its urgent?

2 Answers  


what is runtime class?

0 Answers   MAQ,


is public static void main() work in java?is "String arg[]" needed as argument?

4 Answers   Tech Mahindra,


how to store and retrive a set of values without using an array

8 Answers   FCS, HCL, Maximus,


Why the program getting error if we don't use String args[] in main(), even in the case of not getting any arguments from command line?

1 Answers  


How to create Date method to set the date in Ms Access

0 Answers  


how to create a (*)pyramid using java codes???

5 Answers   Infosys,


write a java program to create a Frame with three scrolls, change the back ground color of the frame using functions with values of scrolls.

0 Answers  


Write a java program to display multiplication table in a Frame.

1 Answers  


Why we r using String args[] in main() even though v r not passing any arguments in command line?

2 Answers  


Is it possible to define marker interface in java.If possible then how to define user defined marker interface?

1 Answers   Tech Mahindra,


Categories