C++ Program to check whether an integer entered by the user is odd or even
HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) |
C++ Program to check whether an integer entered number by the user is odd or even. I have used DEV-C++ compiler for debugging purpose. But you can use any C programming language compiler as per your availability.
cout << "Enter a number: ";
cin >> number;
// True if remainder is 0if( number%2 == 0 )
cout<< number << " is an even number";
cout<< number << " is an odd number";
Tech Study passionately delivers stylish and innovative information to programmer and technology lovers. Tech Study is a young and innovative mind having the zeal to do something useful and creative. Our main goal is to offer step by step debugging solutions for programmers.