write a program that will ask the user to enter a number n and
display the product of all numbers from 1 to n.
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 |
How to create Date method to set the date in Ms Access
In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?
How Can I Trace A Java Program . Please Give Me Step by Step Process
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???
how to create a (*)pyramid using java codes???
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 in java to solve a system of n-variabled simultaneous equations using the guassian elimination method. let the maximum possible value of n be 100. run the program using hypothetical values for a set of 10- variables simultaneous equations. print out the program, the input equation and the results generated by the program.
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?
Is it possible to define marker interface in java.If possible then how to define user defined marker interface?
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?
I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{
1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value