Azzera filtri
Azzera filtri

how to write a code using while end loop for display of number from 10 to 1 descending order ?

6 visualizzazioni (ultimi 30 giorni)
Without using sort

Risposta accettata

KSSV
KSSV il 11 Lug 2022
n = 10 ;
while n ~= 1
n = n-1
end
n = 9
n = 8
n = 7
n = 6
n = 5
n = 4
n = 3
n = 2
n = 1

Più risposte (1)

Hrusheekesh
Hrusheekesh il 11 Lug 2022
n=11;
while n>1
n=n-1
end

Categorie

Scopri di più su Loops and Conditional Statements 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!

Translated by