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
- Which of the following is a property of an admissible heuristic in A* search?
- A /26 subnet is divided into equal /28 subnets. How many /28 subnets are created?
- A memory management scheme divides a process into variable-sized logical units based on its structure (e.g., code, data, stack). This scheme suffers primar...
- First layer of TCP/IP Suite name
- If a set 𝐴contains 4 elements, how many elements are there in its power set?
- Consider the following C code: #include #include int main() { char str1[] = "Hello"; char str2[] = {'W', 'o', 'r', 'l', 'd', '\0', 'X'};...
- Which of the following characteristics is NOT essential for cloud computing?
- CDATA is used in XML to:
- Consider the following C code snippet for calculating base raised to the power of exp: #include double power(double base, int exp) { ...
- Which CPU scheduling algorithm assigns each process a fixed small time slice (quantum) and cycles through the ready queue, making it well suited for time-s...
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)