LAB 4 Lab Exercises 1. Create a C++ program that finds the biggest number between two numbers. Create a function find_bigger(). 2. Modified the program in Question 1 by using the return value.
QUESTION 1 source code /* Name : xxx Date : 280208 Description : Lab 4 Q1 Made with Dev C++ 4.9.9.2 */ #include #include using namespace std; int find_bigger(int, int); int main() { int value1; int value2; cout<<"\nEnter Number : "; cin>>value1; cout<<"\nEnter Number : "; cin>>value2; find_bigger(value1, value2); return 0; } int find_bigger(int x, int y) { int find_bigger = x; if (y > find_bigger) find_bigger = y; cout<<"\nBiggest Value Here is: "<
console application
QUESTION 2 source code /* Name : xxx Date : 280208 Description : Lab 4 Q2 Made with Dev C++ 4.9.9.2 */ #include #include using namespace std; int find_bigger(int, int); int main() { int value1; int value2; int maximum; cout<<"\nEnter Number : "; cin>>value1; cout<<"\nEnter Number : "; cin>>value2; maximum = find_bigger(value1, value2); cout<<"\nBiggest Value Here is: "<<maximum<<endl<<endl; cout<<endl; system ("pause"); } int find_bigger(int x, int y) { int find_bigger = x; if (y > find_bigger) find_bigger = y; }
return find_bigger;
console application