Pascal/Turbo Pascal - ayuda me complila pero no hace lo k kiero¡¡

 
Vista:

ayuda me complila pero no hace lo k kiero¡¡

Publicado por robinson lopez (1 intervención) el 15/05/2012 07:14:54
Diseñe un programa que lea tres números A, B, C y visualice en pantalla el valor del más grande. Se supone que los tres valores son diferentes.
( el inicio no o puse no mas la ezstructura xD)

xfa si es posible hoy le eh dadvo vuel a sto y nd, apenas enpiezo a programar xd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
writeln ('ingrese el primer numero: ');
 readln (a);
 writeln ('ingrese el segundo numero: ');
 readln (b);
 writeln ('ingrese el tercer numero: ');
 readln (c);
 
 
 if (a>b) and (a>c) then;
 begin
 num1:=a;
 write (' el numero mayor es, ',num1);
 end;
 
 if (b>a) and (b>c) then;
  begin
 num2:=b;
 write (' el numero mayor es: ' ,num2);
 end;
 begin
 write (' el numero mayor es: ',c);
 end;
readkey;
end.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

ayuda me complila pero no hace lo k kiero¡¡

Publicado por ramon (2158 intervenciones) el 15/05/2012 17:16:22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{Algo como esto querías es tu programa ajustado compara lo}
 
program xd;
uses
   crt;
var
   aux, a, b, c : integer;
begin
   clrscr;
   write('ingrese el primer numero  : ');
   readln(a);
   write('ingrese el segundo numero : ');
   readln(b);
   write('ingrese el tercer numero  : ');
   readln(c);
   if a > b then
   begin
       aux := b;
       b := a;
       a := aux;
   end;
   if b < c then
   begin
       aux := c;
       c := b;
       b := aux;
   end;
     write (' el numero mayor es : ',b);
    readkey;
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar