what is diference between return 0 and return NULL??

Answers were Sorted based on User's Feedback



what is diference between return 0 and return NULL??..

Answer / sourabh

return 0 means the function returns the particular value 0
returnn null means the function does not return any value'

Is This Answer Correct ?    5 Yes 1 No

what is diference between return 0 and return NULL??..

Answer / dips

return 0 is indicatiion of successsfull completetion of
programme generally we write return 0 for that purpose
return null its returnig nothing in some condition we may
dont require to return any value

Is This Answer Correct ?    3 Yes 2 No

what is diference between return 0 and return NULL??..

Answer / bajishareef

o is the value oriented decimal constant which is of integer type.
Where as NULL is the address oriented empty value.
Both are not equal

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

main() { int x=5,y=10,z=0; x=x++ + y++; y=y++ + ++x; z=x++ + ++y; printf("%d%d%d\n",x,y,z); }

1 Answers   CodeChef,


Can a variable be both const and volatile?

0 Answers  


triangle number finding program...

1 Answers   HCL,


What is difference between structure and union in c programming?

0 Answers  


By using C language input a date into it and if it is right?

0 Answers   Aricent,






Result of the following program is main() { int i=0; for(i=0;i<20;i++) { switch(i) case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf("%d,",i); } } a)0,5,9,13,17 b)5,9,13,17 c)12,17,22 d)16,21 e)syntax error

8 Answers   IBM,


I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....

2 Answers  


#include<stdio.h> #include<conio.h> void main() { char ch='\356'; printf("%d",ch); } o/p=-18 why?plz.explain

2 Answers  


Disadvantages of C language.

0 Answers   Impetus,


What are the types of macro formats?

0 Answers  


What is the use of pragma in embedded c?

0 Answers  


consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is

4 Answers   TCS,


Categories