function with parameters

Solutions on MaxInterview for function with parameters by the best coders in the world

showing results for - "function with parameters"
Mario
28 Jul 2016
1// program to print a text
2
3#include <iostream>
4using namespace std;
5
6// display a number
7void displayNum(int n1, float n2) {
8    cout << "The int number is " << n1;
9    cout << "The double number is " << n2;
10}
11
12int main() {
13     
14     int num1 = 5;
15     double num2 = 5.5;
16
17    // calling the function
18    displayNum(num1, num2);
19
20    return 0;
21}