Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write an expression that checks if given integer is odd or even.
- using System;
- class OddEven
- {
- static void Main()
- {
- Console.Write("Enter number: ");
- string a = Console.ReadLine();
- int odd = int.Parse(a);
- if (odd % 2 == 0)
- {
- Console.WriteLine("false");
- }
- else
- {
- Console.WriteLine("true");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement