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

n = 1;
for(n=1;flag!=0;n=n+2)
if((sqrt(n)>120)||(rem(n,13)~=0))
if rem(n,2)==1;
continue
else
break
end
end
end

str = [\'The number is: \' num2str(n)];
disp(str);

 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