Write a program that prompts the user to enter two integers

Write a program that prompts the user to enter two integers m and n (m

Solution

% Matlab code Algorithm is same you can implement in any software

m = input(\'Enter m value:\')
n = input(\'Enter n value greater than m:\')
sum=0;
for k=m:1:n
  
sum=k+sum;
end

sum

-------------------------------

Result

-----------

>> summ
Enter m value:5

m =

5

Enter n value greater than m:9

n =

9


sum =

35

 Write a program that prompts the user to enter two integers m and n (m Solution% Matlab code Algorithm is same you can implement in any software m = input(\'En

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site