answersLogoWhite

0

A function in C++ are a set of command or a piece of code that needs to be executed again and again with different or same parameters

for expample

void somefunc()

{

cout<<"Hello";

}

will print hello whenever the function is called

or

int add(int a,int b)

{

return a+b;

}

This function will return the sum of the parameters passed to invoke this function you need to write a line

add(4,5);

and it will return "9"

User Avatar

Wiki User

14y ago

What else can I help you with?