Advertisement
henriqueforino

Lista1_Ex4

Dec 11th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.56 KB | None | 0 0
  1. Program LISTA1_QUESTAO4 ;
  2. uses crt;
  3. const
  4.     x = 10;
  5.     y = 5;
  6.     z = 2;
  7. var
  8.     n: integer;
  9.    
  10. Begin
  11.     textbackground (white);
  12.     textcolor (blue);
  13.     clrscr;
  14.     writeln ('Digite um valor: ');
  15.     readln (n);
  16.     if n mod x = 0 then
  17.     writeln ('O número é divisivel por 10')
  18.     else
  19.     if n mod y = 0 then
  20.     writeln ('O número é divisivel por 5')
  21.     else
  22.     if n mod z = 0 then
  23.     writeln ('O número é divisivel por 2')
  24.     else  
  25.     if (n mod 10<>0)  and (n mod 5<>0) and (n mod 2 <>0) then
  26.     writeln ('O valor não é divisível por 10, 5 ou 2.');
  27.         readln () ;
  28.      
  29. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement