+ 1

Difference between return 0 and return 1 ??

3rd Feb 2018, 10:40 AM
Abhay Sardhara
Abhay Sardhara - avatar
3 Answers
0
return is used when one function is called within another... Return 0 return a value of Zero when it is called Return 1 returns value of one. Eg:- int function(int x) { if (x =1) return 0; else return 1; } int main() { int y; function(5) // other than 1 y = x*2 cout << y ; // Prints 2 (1*2). return 0; function(1) y = x*2 cout << y ; // Prints 0 (0*2) return 0; }
3rd Feb 2018, 11:07 AM
Parv Thacker
Parv Thacker - avatar
+ 1
thanks buddy
3rd Feb 2018, 11:09 AM
Abhay Sardhara
Abhay Sardhara - avatar
0
welcome â˜ș
3rd Feb 2018, 11:10 AM
Parv Thacker
Parv Thacker - avatar