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 |
Why we r using String args[] in main() even though v r not passing any arguments in command line?
how to print a message to console without using main() function?(do not use even static blocks also.)
In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?
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?
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?
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.
Program to print map of India in java.
Write a java program to display multiplication table in a Frame.
write a c program which takes 20 numbers in an array as input from user and rearrange them in two different array defining even or odd
A game that has five levels of play has the score for each level stored in an array. You are to write a program that goes through that array and finds: a) the minimum score, and the level at which it occurred b) the maximum score, and the level at which it occurred c)the average score for all five levels The score data you must use for this program are as follows: Game Level Score 1 450 2 316 3 148 Stack implementations is mandatory.
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?
Can we run Applet in Web browser with security policy files