I need to make a program which is capable of inputing numbers containing upto 100 digits. Which variable type will be suitable for holding such a large number? Should I make a string 101 long?
The question (on which I am working) link -> http://cpbook.subeen.com/2012/11/even-odd-2.html
The question is in Bengali. Therefore, most of the people here won't understand the question. For your ease, I've prepared an English Translation of the question -
A whole number will be given, and you have to make a program that will
determine whether it's an even or odd number.
In the first line, there will be an integer T denoting the number of
testcases. In the following T lines, a non-negative integer will be
given.The number can have maximum 100 digits.
For every whole number given, you will have to print whether it's odd
or even as output.
The program will input a number and determine whether its odd or even
Read the input in a string (
char ) and analyze only last digit to check whether number is odd or even. Rest of the digits are irrelevant for this task.