Write a program in a script file that finds the smallest odd

Write a program in a script file that finds the smallest odd integer that is divisible by 13 and whose squareroot is greater than 120. Use a for-loop in the program. The loop should start from 1 and stop when the number is found. The program prints the message \"The required number is:\" and then prints the number.

Solution

for n=1:inf
if(rem(n,2)~=0 && rem(n,13)==0)
if(sqrt(n)>120)
disp(\'The required number is \');
disp(n);
break;
end
end
end

 Write a program in a script file that finds the smallest odd integer that is divisible by 13 and whose squareroot is greater than 120. Use a for-loop in the pr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site