Computer Science, asked by Anonymous, 3 months ago

write a jva program to find the sum of first five natural numbers ​

Answers

Answered by nilamkumari91229
2

Answer:

Using Java for Loop

  • public class SumOfNaturalNumber1.

{

  • public static void main(String[] args)

{

  • int i, num = 10, sum = 0;

//executes until the condition returns true.

for(i = 1; i <= num; ++i)

  • {

Answered by Anonymous
5

Refer to the above attachment

{\fcolorbox{blue}{black}{\blue{\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:HumanIntelligence\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:}}}

Attachments:

Anonymous: please mark as BRAINLIEST
Similar questions