Create a function named volume with 3 default arguments and call it in various ways

 /*Create a function named volume with 3 default arguments and call it in various ways*/

#include<iostream>

using namespace std;

void volume(int l=5,int b=6,int h=7){

int vol=l*b*h;

cout<<"Volume is : "<<vol<<endl;

}

int main(){

volume();

volume(10,20,30);

return 0;}


0 Comments had been done yet:

Post a Comment