AnandaVieira

Exercicio 34

Apr 1st, 2021
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ScriptCSharp
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.         /*Exercício 34
  11.         Digitar um valor qualquer e imprimir se o valor digitado é “Par” ou “Ímpar”.
  12.         Atenção: os números dever ser maiores que zero.*/
  13.  
  14.         Console.WriteLine("Digite um número: ");
  15.         int num = int.Parse(Console.ReadLine());
  16.  
  17.         if (num % 2 == 0) {
  18.         Console.WriteLine("Esse número é par! "); }
  19.         else {
  20.             Console.WriteLine("Esse número é impar!"); }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment