Q283
What is the output of the following code? #include int get_sum(int n) int sm, i; for(i = 1; i <= n; i++) sm += i; return sm; int main() int n = 10; int ans = get_sum(n); printf("%d",ans); return 0;
A.
55
B.
45
C.
35
D.
Depends on compiler
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board