package com.codegym.task.task05.task0530;
import java.io.*;
/*
Boss, something weird is happening
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String num1=reader.readLine();
String num2=reader.readLine();
int a = Integer.parseInt(num1);
int b=Integer.parseInt(num1);
int sum = a + b;
System.out.println("Sum = " + sum+" the sum of the entered numbers.");
}
}
whats wrong in my code , last condition was not satisfied by the compiler . can anyone help me this
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Kuldeep Mangrola
2 July 2019, 08:23
line = 16 you storing num1 instead of num2 &&
line = 19 System.out.println("Sum = " + sum); only display the result this way
don't write extra string like
" the sum of the entered numbers."
0
MBC
1 July 2019, 14:25
You are reading in num1 into both integer inputs, instead of num1 for the first input and num2 for the second one.
So change it to
0