1.

Write function definitions with example

Answer»

The program contains two functions namely exchange and swap which call the exchange function. In main function swap function is called, which actually call the exchange function. In call of exchange function first argument is a address of variable and second argument is value of the variable. In call of the swap function both argument contains the address of the variable. After the execution of program the value of ‘a’ is 15 and value of ‘b’ is 5. 

int themax(int a)

{

return a;

}

int themax(int a,int b)

{

if(a>b)

return a;

else return b;

}

int themax(int a[ ])



Discussion

No Comment Found

Related InterviewSolutions