Advertisement
ranisalt

Exemplo If-Else 1

Dec 28th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.25 KB | None | 0 0
  1. int x = Convert.ToInt32(Console.ReadLine());
  2. if (x > 0)
  3. {
  4.     Console.WriteLine("{0} é um número positivo!", x);
  5. }
  6. else if (x < 0)
  7. {
  8.     Console.WriteLine("{0} é um número negativo!", x);
  9. }
  10. else
  11. {
  12.     Console.WriteLine("{0} é um número neutro!", x);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement