Sunday, February 17, 2013

Function without any return type

#include <iostream>
using namespace std;

void add(int x, int y){
    int res = x+y;
    cout<<res<<endl;
}

int main()
{
    int x,y;
    x=2;
    y=5;
    add(x,y);
    return 0;
}

No comments:

Post a Comment