How could find multiples of a given number N ?
145 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
The input is taken from the user.
0 Commenti
Risposta accettata
Più risposte (2)
ilker melik
il 30 Lug 2020
Modificato: ilker melik
il 30 Lug 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
il 26 Apr 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 Commenti
Vedere anche
Categorie
Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!