Question
Consider the following C code snippet: #include int recursiveSum(int
Consider the following C code snippet: #include int recursiveSum(int
n) { static int sum = 0; // Static variable if (n > 0) { sum += n; recursiveSum(n - 1); } return sum; } int main() { printf("First call: %d\n", recursiveSum(3)); printf("Second call: %d\n", recursiveSum(2)); return 0; } What will be the output of the main function?
More IT Operating System Questions
- Which of the following scheduling algorithms minimizes average seek time?
- In n-gram models, what does 'n' represent?
- In a 4-bit DAC, reference voltage is 5 Volts , then analog voltage corresponding to binary data is 1001 is _______
- A processor uses a write-back cache policy rather than write-through. What is the primary trade-off this design choice introduces?
- What is the primary purpose of using private class members in object-oriented programming?
- Spark performs better than Hadoop MapReduce because:
- A priority scheduling system suffers from starvation of low-priority processes. Which technique specifically addresses this?
- Recursive algorithms, often central to Divide and Conquer, are prone to specific debugging challenges. Which of the following is a primary concern when deb...
- Which of the following data structures offers O(1) average-case time complexity for insertion, deletion, and search operations?
- Which of the following statements accurately describes the layer functionality of a router in network communication?
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)