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 _00_vm_3_ora
- {
- class Program
- {
- //beolvasás és kiíratás fv ben történjen
- //a beolvastt szám +/- és páros v. páratlan
- static void Main(string[] args)
- {
- Console.Write("Adj egy számot: ");
- int szam = beolvas();
- if (szam == 0)
- {
- kiir("A szám nulla!");
- }
- else if (szam%2==0)
- {
- kiir("A szám páros és ");
- }
- else
- {
- kiir("A szám páratlan és ");
- }
- if (szam > 0)
- {
- kiir("pozitív.");
- }
- else if (szam == 0)
- {
- //Console.Write("nulla.");
- }
- else
- {
- kiir("negatív.");
- }
- Console.ReadLine();
- }
- static void kiir(string szoveg)
- {
- Console.Write(szoveg);
- }
- static int beolvas()
- {
- return int.Parse(Console.ReadLine());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement