Write a voidfunction definition for a function called zerobo

Write a void-function definition for a function called zero_both that has two refernce parameters, both of which are variavles of type int, and sets the values of both variables to 0.

Solution

void zero_both(int a , int b){
   int a = 0; //Initialize variable a to 0
   int b = 0; ////Initialize variable b to 0

System.out.println(\"Value of a = \" + a); //This will print 0 to console

System.out.println(\"Value of b = \" + b); //This will print 0 to console

}

Write a void-function definition for a function called zero_both that has two refernce parameters, both of which are variavles of type int, and sets the values

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site