Functions in C++

Types of Functions in C++ are : Library functions User Defined Functions The main( ) Function ANSI does not specify any return type for the main ( ) function which is the starting point for the execution of a program . The definition of main( ) is This is property valid because the main () in ANSI C does not return any value. In C++, the main () returns a value of type int to the operating system. The functions that have a return value should use the return statement…

Read More

Functions in C++

Which one of the following statements is a valid main function prototype? void main (   ); int main (int a, int b) main (int argc, char argv); int main(int argc, char* argv[ ]); Which one of the following is true about a function in a C++ program? A function must be called at least once. A function may called as and when required. A function can be called only by the main function. A function must always return a value. Which of the following function prototypes is invalid? void exchange…

Read More