In case of integer overflow, Which of the following option/s is/ are true?
Answers
Answer:
There is no options....
The correct question is :
In case of integer overflow, Which of the following option/s is/are true?
1.It is a result of an attempt to store a value greater than the maximum value an integer can store
2.Integer overflow can compromise a program's reliability and security
3.Both A and B
4.None of the above
Answer:
For the above question, "Option 2" is the correct option.
Explanation:
An integer overflow occurs when the result of an integer operation does not fit within the allocated memory or, the numeric value is outside of the range that can represent with a given number of digits.
example:
Write a C function int add (int* result, int p, int q) if there is no overflow, the function places the resultant = sum a+b in the result and returns 0. Otherwise, it returns -1.