How do I find all odd numbers between 1 and 60 but are divisible by 5?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How do I find all odd numbers between 1 and 60 but are divisible by 5 using the for loop?
Respuestas (1)
Walter Roberson
el 21 de Oct. de 2023
hint:
for i = 1 : 60
r7 = remainder7(i);
if r7 == 0; disp(i); end
end
function v = remainder7(v)
while v >= 7
v = v - 7;
end
end
0 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!