4 4 votes Point out the error : #include <stdio.h> void f(int*); int main() { int i=35,*z; z=f(&i); printf("%d",z); return 0; } void f(int*m) { return(m+2); } error in function call error in return statement error in argument of f() error in pointer initialization Programming in C tbb-programming-2 programming-in-c pointers functions + – Bikram 1.5k views answer comment Share Follow Print See 1 comment 1 1 comment reply JashanArora commented Dec 27, 2019 reply Follow flag Void functions can't return values. You can, however, write return statements in them at the end to enhance user readability. https://stackoverflow.com/questions/22719242/returning-a-value-from-a-void-function 0 0 replyShare Please log in or register to add a comment.
Best answer 9 9 votes A void function cannot return a value though it can have a return statement. So, the answer is B. Samridhi Tyagi answered May 20, 2017 • selected May 21, 2017 by Arjun Samridhi Tyagi comment Share Follow See all 8 Comments 8 8 Comments reply Show 5 previous comments val_pro20 commented Jan 6, 2019 reply Follow flag @joshi_nitish @Bikram even if u want to write a return statemnt for a void function(which is incorrect but lets suppose it compiles successfully ) then also return should be written like return; and not return(m+2);is it valid 0 0 replyShare Sambhrant Maurya commented Jul 15, 2019 reply Follow flag z=f(&i); Is this correct? What does it mean? 0 0 replyShare Bikram commented Aug 19, 2019 reply Follow flag https://gateoverflow.in/129778/test-by-bikram-2017-programming-test-2-18?show=130298#c130298 https://gateoverflow.in/129778/test-by-bikram-2017-programming-test-2-18?show=130312#c130312 0 0 replyShare Please log in or register to add a comment.