+ 2

What is meant by return type?

4th Sep 2016, 9:09 AM
Wycliffe Omondi
Wycliffe Omondi - avatar
3 Respuestas
+ 1
main() returns an int type to operating system.therefore, evry main() shud end with a return(0) statement; otherwise a warning or an error might occur.note that default return type for all functions in c++ us int. hope now u ll understand the concept of return.
4th Sep 2016, 9:54 AM
Shivesh Karan Mehta
Shivesh Karan Mehta - avatar
+ 1
The return type is the type of data your function should return. If your function has the return type void it shouldn't return anything; void means nothing. If your function has the return type int or double it should return a number or a variable with the same type as the return type.
4th Sep 2016, 10:04 AM
bogdan
bogdan - avatar
0
Return type means what kind of value your function is giving back for example int , float , double int - when ur func returns val like 2 3 4 5 6 17 ... float - when ur func returns val like 1.2 3.5 4.466 3.14 ........... double - for values like 235667
11th Mar 2017, 7:34 AM
Harsh Dhaundiyal
Harsh Dhaundiyal - avatar