...
Programming-for-Output-Problems
September 29, 2023
Programming-for-Output-Problems
September 30, 2023
Programming-for-Output-Problems
September 29, 2023
Programming-for-Output-Problems
September 30, 2023

Programming

Question 1
Consider the following C program:
#include <stdio.h>
int counter = 0;
int calc (int a, int b) {
int c;
counter++;
if (b==3) return (a*a*a) ;
else {
c = calc (a, b/3) ;
return (c*c*c) ;
}
}
int main () {
calc (4, 81);
printf (“%d”, counter) ;
}
The output of this program is ______.
A
4
B
5
C
6
D
7
Question 1 Explanation: 
Correct Answer: A
Question 1 Explanation: 
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!