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
- Consider the following Java code: class Animal { String type = "Generic Animal"; void eat() { System.out.println("Animal eats food."); ...
- You encounter a bug that only appears intermittently and is difficult to reproduce. What is this type of bug often called?
- A data analysis application needs to quickly find the minimum or maximum value in a dynamically changing dataset. While a min/max heap could be used, how w...
- A system uses 4 KB pages and a 32-bit virtual address. How many address bits identify the page offset?
- Which of the following statements is true regarding the reliability requirements of the Spiral Model in software development?
- What is the main advantage of using knowledge graphs in AI?
- Which of the following statements about a B+ Tree is correct?
- Which of the following statements about a router is correct?
- State True or False Kernel level thread cannot share the code segment.
- What is the time complexity of Heap Sort in the worst case and what type of heap is used to sort an array in ascending order?
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)