Computer Science, asked by devilknight59, 9 months ago

wap to print sum of all numbers from m to n​

Answers

Answered by prashantrohilla32
0

Answer:

public class Main

{

public static void main(String[] args) {

   

   int m=1;

   int n=5;

   int sum=0;

   

   for(int i=m;i<=n;i++)

   {

 sum=sum+i;

   }

   System.out.println(sum);

}

}

Explanation:

It is a java program.

Attachments:
Similar questions