Write a program that contains and utilizes a function called haltNum(int&). This function utilizes a call by reference. The function get an argument n and divides it by 2. The program ask for a number, saved as entry , pass it on as an argument for halfNum(), then print the result of halfNum(int & entry) on entry. Solution ----Program Written in C++ Language #include<iostream.h> #include<conio.h> int halfNum(int& n) { return(n/2); } void main() { clrscr(); int entry,result; cout<<\"enter value for entry \"; cin>>entry; result=halfNum(& entry); cout<<\"Result= \"<<result; getch(); } .
Write a program that contains and utilizes a function called haltNum(int&). This function utilizes a call by reference. The function get an argument n and divides it by 2. The program ask for a number, saved as entry , pass it on as an argument for halfNum(), then print the result of halfNum(int & entry) on entry. Solution ----Program Written in C++ Language #include<iostream.h> #include<conio.h> int halfNum(int& n) { return(n/2); } void main() { clrscr(); int entry,result; cout<<\"enter value for entry \"; cin>>entry; result=halfNum(& entry); cout<<\"Result= \"<<result; getch(); } .