Well, first of all you need to know what a factorial is. You haven't demonstrated that you know anything on how to solve this problem yet. If you need a description on what a factorial is here's a link. http://mathworld.wolfram.com/Factorial.html
You would have to have a loop inside of a loop in order to make this work. Here's a little bit of code to get you started on your merry way:
int factorial = 4;
int result = 1;
for (int i = 0; i < factorial; i++)
result *= i+1;
System.Console.WriteLine("result:" + result);
the factorial is saved to the int result. If you want multiple answers just put the whole thing in a for loop incrementing factorial till you get to the desired value.
Hope this is helpful. I don't want to solve the whole thing for you though...
thanks a lot for the help both of ya guys..the way i did using the code above as following and worked perfectly fine for the results required...
static void Main(string args)
Console.WriteLine("Enter the number: ");
num = int.Parse(Console.ReadLine());
for (int i = 1; i <=num; i++)
int total = 1;
for (j=1; j <= i; j++)
Console.Write("X" + j);
total = total*j;
Console.WriteLine(" = " + total);
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...