Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

my goal is to make the biggest common partition but says syntax error >>> if(y==0)

1 Ansicht (letzte 30 Tage)
oyku gokce
oyku gokce am 1 Jun. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
a=int(input("1.tam sayi: "));
b=int(input("2.tam sayi: "));
fprintf(" \nEBOB(%d,%d)=%d\n" ,a,b,ebob(a,b);
function [S]=ebob(x,y)
if (y==0)
S=x;
else
S=ebob(y,mod(x,y));
end
end

Antworten (1)

KSSV
KSSV am 1 Jun. 2020
Bearbeitet: KSSV am 1 Jun. 2020
You forgot to close the fprintf brackets.
a= input("1.tam sayi: ");
b= input("2.tam sayi: ");
fprintf(" \nEBOB(%d,%d)=%d\n" ,a,b,ebob(a,b));
end
function [S]=ebob(x,y)
if (y==0)
S=x;
else
S=ebob(y,mod(x,y));
end
end

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by