C++ Syntax Question:

Download Job Interview Questions and Answers PDF

What is functions Syntax in C++?

Basic C++ Syntax Interview Question
Basic C++ Syntax Interview Question

Answer:

Functions that a programmer writes will generally require a prototype. Just like a blueprint, the prototype tells the compiler what the function will return, what the function will be called, as well as what arguments the function can be passed. When I say that the function returns a value, I mean that the function can be used in the same manner as a variable would be. For example, a variable can be set equal to a function that returns a value between zero and four.

For example:
#include <cstdlib> // Include rand()

using namespace std; // Make rand() visible

int a = rand(); // rand is a standard function that all compilers have</cstdlib>

Download Basic C++ Syntax Interview Questions And Answers PDF

Previous QuestionNext Question
What is do..while loops structure?How to defines the function in C++?