Computer Science, asked by kanupriya163, 5 months ago

i was writing a Java Program for a ninth class student to multiply all even numbers from 2 to 20 and a picture of it is taken from bluej application attached below. but now, i have made a mistake. can someone please correct me? the wrong statement has been underlined by yellow.

warning- no spam otherwise it answer will be deleted and u will be reported.​

Attachments:

Answers

Answered by sukhmanam
1

Explanation:

first error is use long instead of int with pro =0 as the product value exceeds the holding capacity of inter data type

2) is use a simple for loop for calculate the product and evalute if the number is eve with the if conditions inside the for loop for every n>2 till n<=20

3) use casting while doing product as

pro=pro×(long)n;

Answered by pankajsaini22877
3

Answer:

Plasma membrane

Answer of this question you asked today if you don't believe in my answer do it Google

Attachments:
Similar questions
Physics, 2 months ago