C++ Function without arguments and without return value

Spread the love..

#include<iostream>
using namespace std;

void sum() //Called function
{
    int a,b,c;
    cout<<"\nEnter two values:=";
    cin>>a>>b ;
    c=a+b;
    cout<<"\nsum="<<c;
}
int main()
{
    sum();
    sum();
    sum();
return 0;
}

Spread the love..

Leave a Reply

Your email address will not be published. Required fields are marked *