How could find multiples of a given number N ?
140 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Neha W
el 29 de Mzo. de 2016
Respondida: RINU BENNY
el 26 de Abr. de 2022
The input is taken from the user.
0 comentarios
Respuesta aceptada
Torsten
el 29 de Mzo. de 2016
"input" is a multiple of N if and only if mod(input,N)=0.
Best wishes
Torsten.
Más respuestas (2)
ilker melik
el 30 de Jul. de 2020
Editada: ilker melik
el 30 de Jul. de 2020
function c = finding_multipliers(y) % y is the number that you are looking for.
count = 0;
n = 1;
while n < y
if mod(y,n) == 0
count = count + 1;
c(count,1) = n;
end
n = n + 1;
end
This can be a helpful function.
RINU BENNY
el 26 de Abr. de 2022
n=input('enter the number whose multiple is needed'); m=input('enter the range of multiples needed'); for i=0:m if mod(i,n)==0 disp(i); end end
0 comentarios
Ver también
Categorías
Más información sobre Multidimensional Arrays 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!