+ 1
What's false ? I'm sorry if it's really easy to find but I've been doin this for 1 hour and ain't being good >.<
public class Program { public static void main(String[ ] args); String num1 = 60; String num2 = 20; num1 % num2; String num3 = num1 + num2; System.println(num1); Thanks for any help(☆^ー^☆)
18 Réponses
+ 2
Yup, that worked. Thanks alot !
+ 1
---> num1 % num2;
do you mean:
num1 = num2;
+ 1
what do you want this code to do?
+ 1
Olin Guerrero I mean num1 ÷ num2
Oh and could I use both, String and int for this one ?
+ 1
First, declare your numbers as int, not String.
Second, the "num1 % num2;" line does nothing. The comper just goes "yup, that's an equation" and does nothing with the result.
Try
num1 = num1 % num2;
or something similar.
+ 1
KAMPFTEDDY McFlausch if you want to devide use "/" so:
num1 = num1 / num2;
+ 1
Jackson O’Donnell, oh, alright. I wanna divide 60 by 20, means num1 divided by num2
+ 1
Oooooh, okay. Got it lol. Thanks for ur help guys^^
+ 1
public class Program {
public static void main(String[ ] args);
int num1 = 60;
int num2 = 20;
num1 = num1 / num2;
int num3 = num1 + num2;
System.println(num1);
+ 1
Nope, still wrong
4 errors.
3 times " <identifier> expected "
And 1 time " Reached end of file while parsing "
+ 1
public class Program {
public static void main(String[ ] args){
int num1 = 60;
int num2 = 20;
num1 = num1 / num2;
int num3 = num1 + num2;
System.println(num1);}};
+ 1
Lol still " Reached end of file while parsing "
+ 1
And " can't find symbol " " System.out.printIn(num1) ;}};
+ 1
KAMPFTEDDY McFlausch oh i forgot, its
System.out.println(num1);
+ 1
Sry to disappoint ya but I already tried that :/
+ 1
public class Program {
public static void main(String[ ] args){
int num1 = 60;
int num2 = 20;
num1 = num1 / num2;
int num3 = num1 + num2;
System.out.println(num1);
}
};
+ 1
+ 1
Hey, why you don't just try like this:
public class Program {
public static void main(String[ ] args){
int num1 = 60;
int num2 = 20;
System.out.println(num1 / num2);
}
};