What is the output of the following code? main() { printf(%d\n,sum(5)); } int sum(int n) { if(n

🎲 Try a Random Question  |  Total Questions in Quiz: 150  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
C Programming Practice Test Questions — practice the complete quiz, review flashcards, or try a random question.


What is the output of the following code? main() { printf(%d\n,sum(5)); } int sum(int n) { if(n<1) return n; else return(n+sum(n-1));