Answers for "c++ how to create a function"

C++
1

c++ function

// the void function
void function() {
 cout << "Hello World!";
}

// the main function
int main() {
 function();
 return 0;
}
Posted by: Guest on May-20-2022
28

how to declare a function in c++

// function example
#include <iostream>
using namespace std;

int addition (int a, int b)
{
  int r;
  r=a+b;
  return r;
}
Posted by: Guest on March-04-2020

Code answers related to "c++ how to create a function"

Browse Popular Code Answers by Language