5 respuestas
program_calculadora;
de la part de mehdi skikda algérie en 2eme année informatique LMD
uses WinCrt; var a,b,r:real; x:char; function add(var a,b: real):real; begin r:=a+b; end; function sub(var a,b: real):real; begin r:=a-b; end; function mul(var a,b: real):real; begin r:=a*b; end; function divis(var a,b: real):real; begin r:=a/b; end; begin writeln('calculette PASCAL'); readln(a); readln(x); readln(b); case x of '+': add(a,b); '-': sub(a,b); '*': mul(a,b); '/': divis(a,b); end; writeln(r); end. de la part de mehdi skikda algérie en 2eme année informatique LMD
RIHEM
pero, ¿cómo se hace eso en Lazarus Pascal?????
Lion
Gracias
este programa no es válido porque
1_el cálculo fi para 1 vez
2_el programa no reconoce el '=' ok;
dame tu msn quiero ayudarte
1_el cálculo fi para 1 vez
2_el programa no reconoce el '=' ok;
dame tu msn quiero ayudarte
Hello,
I noticed 2 errors in your program
1- the 1st in the function divis you must first verify whether b is different from zero
2- the 2nd you must see this ^_^ to understand well
https://pascal.developpez.com/cours/ptrau/?page=page_13#LXIII-D
your problem is located at the two levels: the function calls + the result returned by each function of your program
here is the solution https://pascal.developpez.com/cours/ptrau/?page=page_13#LXIII-D
I noticed 2 errors in your program
1- the 1st in the function divis you must first verify whether b is different from zero
2- the 2nd you must see this ^_^ to understand well
https://pascal.developpez.com/cours/ptrau/?page=page_13#LXIII-D
your problem is located at the two levels: the function calls + the result returned by each function of your program
here is the solution https://pascal.developpez.com/cours/ptrau/?page=page_13#LXIII-D