Guys i was tryinto | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Guys i was tryinto

Write a program that: 1. reads a number N (must be greater than 0) from the console 2. reads N numbers from the console 3. Displays the maximum of the N entered numbers. 4. It should works well for negative numbers too. 5.if N is 0 it should not display anything. I could not do no 5 plis help. https://code.sololearn.com/clGXmBiWQDOB/?ref=app

10th Jun 2020, 8:42 AM
stephen haokip
stephen haokip - avatar
2 Answers
0
stephen haokip If N is 0 just print the message and return the program using return statement like this if (N == 0) { return; }
10th Jun 2020, 9:26 AM
A͢J
A͢J - avatar
0
" it should not display anything." int i = Integer.parseInt(s); if (i>0) {
10th Jun 2020, 9:32 AM
zemiak