Consider a hypothetical machine which supports the following data types:
unsigned char: 1 Byte
unsigned short: 2 Bytes
int: 4 Bytes
Consider the following function red()
int red(unsigned char a, unsigned short b)
{
if (a == 0) return b;
else {
a = a + 1;
b = b*2;
return red(a, b); }
}
int main() {
printf("%d", red((char) 240, 1));
return 0;
}
What will be the output of the following program?
A)The program terminates abnormally
B)The program outputs 65536 (216)
C)The program goes into infinite loop
D)None of these
Answers
Answered by
1
Answer:
c the program goes into infinite loop
because function call self and not break point to break state very weak
Answered by
0
Answer:
option-c
Explanation:
the program goes into infinite loop.
an infinite loop (or endless loop)[1][2] is a sequence of instructions that, as written, will continue endlessly, unless an external intervention occurs ("pull the plug"). It may be intentional
FINAL ANSWER- option-c
#SPJ3
Similar questions
Math,
2 months ago
Science,
2 months ago
Social Sciences,
4 months ago
Math,
4 months ago
Physics,
10 months ago
Computer Science,
10 months ago