0

Whats wrong in this Code?

public class Main{ public static void main(String[]args){ System.out.println("Number");     int num1 = 1;     int num2 = 2;     int num3 = 3;     Ans = num1 + num2 + num3;     System.out.println(Ans); } }

21st Oct 2020, 7:29 PM
NIHAL
NIHAL - avatar
2 Réponses
+ 1
Define the type of Ans. Add int before the variable name.
21st Oct 2020, 7:31 PM
QTWizard
+ 2
Thank you
21st Oct 2020, 7:43 PM
NIHAL
NIHAL - avatar