• June 13, 2021


Bring Technology Ideas with you

 Integers in programming language

    An integer could be a entirety number (not a division) that can be positive, negative, or zero. Subsequently, the numbers 10, 0, -25, and 5,148 are all integers. Unlike floating point numbers and double, integers cannot have decimal places. By default, the integer data type is a 32-bit signed two’s complement integer, which has a minimum value of -231 and a maximum value of 231-1. As an example:

    using namespace std;
    int main()
    	int n;
    	cout << "Enter an integer: ";
    	cin >> n;
    	if (n % 2 == 0)
    		cout << n << " is even.";	
    		cout << n << " is odd.";
    	return 0;

    The example the above is finding Even and Odd number in C++ programming

    Related post