GeeksforGeeks » Interview Questions
Interview Question for Software Engineer/Developer (Fresher) about CPuzzles
(2 posts)-
using only one '+' operator, write a C function sum(x, y, z) that returns sum of x, y and z.
-
Use recursion :)
int sum(int x, int y, int z) { if (x || y || z) return x + sum(y, z, 0); else return 0; }
Reply
You must log in to post.