In C program, at end of the program we will give as "return 0"
and "return 1", what they indicate? Is it mandatory to specify
them?

Answers were Sorted based on User's Feedback



In C program, at end of the program we will give as "return 0" and "return 1",..

Answer / ranjeet roy

if the return type of our function is int ..
thn it is maindetory to return something like 0 nd 1..
but if we declare the return type void
then doesnt require

Is This Answer Correct ?    21 Yes 1 No

In C program, at end of the program we will give as "return 0" and "return 1",..

Answer / hari

yeah....... its necessary to return some value if the return type of main() is 'int'.
in fact we can return any valid integer.
here are few examples... all are correct;;;;;;>

return 0;
return 1;
return 100;
return -3;
return 'c';

Is This Answer Correct ?    5 Yes 0 No

In C program, at end of the program we will give as "return 0" and "return 1",..

Answer / ritu

yes

Is This Answer Correct ?    0 Yes 0 No

In C program, at end of the program we will give as "return 0" and "return 1",..

Answer / sivavendra

Yes, it is mandatory to return some value if return type of main() is specified as "int"

Is This Answer Correct ?    0 Yes 0 No

In C program, at end of the program we will give as "return 0" and "return 1",..

Answer / kalyan chukka

i think 0 and 1 are the true false.

Is This Answer Correct ?    1 Yes 11 No

Post New Answer

More C Interview Questions

what will be the output of the following program, justify? #define TEST int TEST getdata() { static i; i+=10; return i; } main() { int k; k = getdata(); }

3 Answers  


Write a simple program to find the size of different basic data types in C.

3 Answers  


Explain pointer. What are function pointers in C?

0 Answers   HCL,


What is the heap in c?

0 Answers  


void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }

3 Answers  






Is boolean a datatype in c?

0 Answers  


Explain can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


How old is c programming language?

0 Answers  


how many header file is in C language ?

44 Answers   College School Exams Tests, CTS, IBM, IMS, Infosys, ME, Sign Solutions, Wipro, XVT,


How will you write a code for accessing the length of an array without assigning it to another variable?

0 Answers  


what is the difference between const char *p, char const *p, const char* const p

5 Answers   Accenture, Aricent, CTS, Geometric Software, Point Cross, Verizon,


What are linker error?

0 Answers  


Categories