0
Print the following java. Enter 5 random numbers. Add the adjacent number. The adjacent numbers in the result should be added.
ex 1 2 3 4 5 6(add adjacent) 3 5 7 9 (add adjacent) 8 12 16 (add adjacent) 20 28 (add adjacent) 48
2 Answers
+ 2
We can use array
0
@Saumya I used scanner to input the 5 numbers
then I used two for loops but after second line of output, the ans is different