wap to print sum of all numbers from m to n
Answers
Answered by
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
Social Sciences,
4 months ago
English,
4 months ago
English,
9 months ago
Math,
9 months ago
Geography,
1 year ago