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

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

0 Answers  


write a program that inputs two real numbers then exchanges their values.

7 Answers   Infosys,


Can we run Applet in Web browser with security policy files

0 Answers  


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

2 Answers  


How Can I Trace A Java Program . Please Give Me Step by Step Process

1 Answers   IBM,


what are the other loops except for for,while,do while and until?

0 Answers   Aricent,


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

5 Answers   Infosys,


Write a program to convert a decimal number to binary form?

1 Answers   Oracle,


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

1 Answers  


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  


For printing a message we use System.out.println in normal programs. We use String msg="text....."; Can't we use String msg=" " in normal programs and System.out.println("........") in applets. Please answer this question?

0 Answers  


Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???

0 Answers  


Categories