0 votes 0 votes #define LIMIT 1000 void fun2(int n) { if (n <= 0) return; if (n > LIMIT) return; printf("%d ", n); fun2(2*n); printf("%d ", n); } Will it be non terinating recursion if n is negative,if so then why? deepak_yadav asked Jan 20, 2017 deepak_yadav 461 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes If you pass any value less then equals to 0 then it will terminate in the starting condition if( n <= 0 ) return as well as it terminates for value larger then limit (i.e 1000 ). vipsharmavip answered Jan 20, 2017 vipsharmavip comment Share Follow See all 0 reply Please log in or register to add a comment.