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 |
write a program in java to find the moving average of all prime numbers between 2 and 100.
1+(2*3)+(4*5*6)+(7*8*9*10)+... specified input value
In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?
how to store and retrive a set of values without using an array
How Can I Trace A Java Program . Please Give Me Step by Step Process
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 we r using String args[] in main() even though v r not passing any arguments in command line?
Write a program to convert a decimal number to binary form?
does anyone know the code to display a triangle using a applet?
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?
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.