Question
Consider the following C code snippet for calculating base raised to the power of exp: #include double power(double base, int exp) { if (exp == 0) { return 1; } // Missing handling for negative exponent return base * power(base, exp - 1); } int main() { printf("%.2f\n", power(2.0, -2)); return 0; } What will be the output or behavior of the program when power(2.0, -2) is called?
More IT Operating System Questions
- In PAM technique which of the below attributes of the pulse is used to vary as the amplitude of message varies
- What is the primary objective of system testing in the software development lifecycle?
- Consider a Java method printList(Node head) for a singly linked list. class Node { int data; Node next; Node(int d) { data = d; next = null...
- Web Pages can be created using :
- Which single command grants the file owner full permissions (read, write, execute), the group read and execute permissions only, and all other users no per...
- Which is best fit for blank space 15?
- A file system uses contiguous allocation. A file occupies blocks 100 –109 and needs five more blocks, but 110 –114 are occupied. What issue is illustrated?
- Consider a min-heap represented as an array: [1, 3, 5, 7, 9]. If the element 2 is inserted into this min-heap, what will be the state of the heap array aft...
- What is a "call stack" in the context of debugging?
- A computer has a 2-way set-associative cache with 8 sets, where each cache line holds 16 bytes of data, and main memory is byte-addressable. How many bits ...
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)