question no. 3...
plzzzzzzzz fast....
Attachments:
Answers
Answered by
3
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int m = 0, n = 0;
Scanner sc = new Scanner(System.in);
System.out.print("Please Eneter a value for m : ");
m = sc.nextInt();
System.out.print("Please Eneter a value for n : ");
n = sc.nextInt();
if(m < n){
int sum = 0;
for(int i = m+1; i<n; i++)
sum+=i;
System.out.println("The sum of numbers between m and n is = " + sum);
}else{
System.out.println("The value of m can't be less than n");
}
}
}
kanakchamola:
java...
Similar questions
Computer Science,
6 months ago
Hindi,
6 months ago
Business Studies,
6 months ago
Biology,
1 year ago