Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Exercicios
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*2. Construa um programa que leia 5 valores e conte quantos destes valores são divisíveis por 3,
- escrevendo esta informação.*/
- int cont = 0;
- for (int i = 0; i < 5; i++)
- {
- Console.Write("Informe o valor: ");
- int a = int.Parse(Console.ReadLine());
- if (a % 3 == 0)
- {
- cont = cont + 1;
- Console.WriteLine("O valor de " + a + " é divisivel por 3 ");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement