fork download
  1. with Ada.Text_IO, Ada.Integer_Text_IO;
  2. use Ada.Text_IO, Ada.Integer_Text_IO;
  3.  
  4. procedure conditions_and_operators is
  5. a,b,c,output : integer;
  6. operator : character;
  7. begin
  8.  
  9. put_line("enter the values of a,b & c: ");
  10. get(a);
  11. get(b);
  12. get(c);
  13. put_line("enter the operation to be performed: ");
  14. get(operator);
  15.  
  16. if(a>b and a>c) then
  17. put_line("a is the greatest");
  18. elsif(b>a and b>c) then
  19. put_line("b is the greatest");
  20. else
  21. put_line("c is the greatest");
  22. end if;
  23.  
  24. case operator is
  25. when '+' =>
  26. output = a+b+c;
  27. goto print;
  28. when '-' =>
  29. output = a-b-c;
  30. goto print;
  31. when '*' =>
  32. output = a*b*c;
  33. goto print;
  34. when '/' =>
  35. output = a/b/c;
  36. goto print;
  37. when others=>
  38. put("check the operator");
  39. end case;
  40. <<print>>
  41. put_line("the output is :");
  42. put(output,3);
  43. end conditions_and_operators;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
gnatgcc -c -pipe -O2 prog.adb
prog.adb:26:10: "=" should be ":="
prog.adb:29:10: "=" should be ":="
prog.adb:32:10: "=" should be ":="
prog.adb:35:10: "=" should be ":="
gnatmake: "prog.adb" compilation error
stdout
Standard output is empty