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  


1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value

1 Answers   MAQ,


In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?

0 Answers   Google, Microsoft,


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

8 Answers   FCS, HCL, Maximus,


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

1 Answers   IBM,


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 we r using String args[] in main() even though v r not passing any arguments in command line?

2 Answers  


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

1 Answers   Oracle,


does anyone know the code to display a triangle using a applet?

1 Answers  


How to create and run runnable jar file of a Java Project.

4 Answers   HCL, TCS, Tech Mahindra, US Consulate, Wipro,


we compile any program bu c:/>javac prog.java and run as c:/>java prog Here what's the meaning of c in javac. We have java Interpreter but not compiler.Then why we have to use javac. Please answer this question?

2 Answers  


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  


Categories