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
write a program that inputs two real numbers then exchanges their values.
Can we run Applet in Web browser with security policy files
Why we r using String args[] in main() even though v r not passing any arguments in command line?
How Can I Trace A Java Program . Please Give Me Step by Step Process
what are the other loops except for for,while,do while and until?
how to create a (*)pyramid using java codes???
Write a program to convert a decimal number to binary form?
write a program that will ask the user to enter a number n and display the product of all numbers from 1 to n.
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?
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?
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???