Results 1 to 3 of 3
Thread: someone help me!!!!!!!!!!!!!
- 11-16-2011, 06:06 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 1
- Rep Power
- 0
someone help me!!!!!!!!!!!!!
import java.util.scanner;
public class AbsTest{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int num = input.nextint();
if(num<0){
num=-num;
}
System.out.println("Absolute value of num is"+num);
}
it shows error reached end of file while parsing
- 11-16-2011, 06:48 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 785
- Rep Power
- 12
Re: someone help me!!!!!!!!!!!!!
- import java.util.scanner; --> import java.util.Scanner;
- int num = input.nextint(); --> int num = input.nextInt();
- three open brackets, two closed brackets --> add } to the end
next time, please post the error message!
-
Re: someone help me!!!!!!!!!!!!!
Amen. Also, next time please use a forum question heading that means something. "help me" tells us nothing other than you need help, and we already know that, else you wouldn't be posting a question here. Instead try to make a question heading that briefly summarizes your problem, just like a newspaper headline briefly summarizes the article below.
Bookmarks