Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- algorytm1();
- Console.Read();
- }
- static int pobierzLiczbe()
- {
- Console.WriteLine("Podaj liczbe:");
- return int.Parse(Console.ReadLine());
- }
- static void algorytm1()
- {
- int liczba = pobierzLiczbe();
- if (kontrolaParzystosci(liczba))
- {
- Console.WriteLine("Parzysta");
- }
- else
- {
- Console.WriteLine("Nieparzysta");
- }
- }
- static bool kontrolaParzystosci(int liczba)
- {
- if (liczba % 2 == 0)
- {
- return true;
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement