+ 1

Please correct this code

The description I have written as comments in the code I'm still not able to find the logical error in my code it's related to Maths *Prime1 + Prime2 = even number(entered) https://code.sololearn.com/cuYz0SarodNn/?ref=app

14th Jan 2023, 10:55 AM
Rajdeep Singh
Rajdeep Singh - avatar
2 ответов
+ 1
if(g == 0 ) { System.exit(0);//to end the program after the result } This cause your program to exit whatever even input you add .. For i=1,j = 1, g=0 so exits..
14th Jan 2023, 11:35 AM
Jayakrishna 🇮🇳
+ 1
If that is the case the desired result should display first
15th Jan 2023, 11:35 AM
Rajdeep Singh
Rajdeep Singh - avatar