Having problem with factorial

Hi guys, I don't understand what i'm doing wrong here. I'm supposed to print factorial of the inserted integer.

1. first to ask the number (for example 3)

2. count its factorial and print it on the screen (6) 1*2*3 = 6

**Here's my code**

import java.io.*;

public class factorial {

public static void main(String[] args) throws IOException {

int i, num, factori;

factori = num;

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

for(num<0; num=<factori) {

System.out.print("Insert number:"); {

num = Integer.parseInt(in.readLine());

System.out.println("The factorial of" +num+ "is" +factori);

}

}

}

Thanks

Re: Having problem with factorial

For one, I don't see where you're calculating the number's factorial.

Also please wrap your code in [code] [/code] tags so that it retains its formatting and is easier to read.