I searched this site and found some answers but still can't get this program to return the lowest number it just keeps returning "int a" instead of the lowest number I can't seem to find what is wrong with it
New to site and don't know how to properly display the code so I copied and paste it any help will be appreciated.
Code:
#include <iostream>
using namespace std;
int findLowest(int a, int b, int c, int d, int e);
int main ()
{
int test1;
int test2;
int test3;
int test4;
int test5;
int lowest;
cout << "Enter first test score : ";
cin >> test1;
cout << "Enter second test score: ";
cin >> test2;
cout << "Enter third test score : ";
cin >> test3;
cout << "Enter fourth test score: ";
cin >> test4;
cout << "Enter fifth test score : ";
cin >> test5;
lowest = findLowest(test1, test2, test3, test4, test5);
cout << " Lowest number is: " << lowest << endl;
return 0;
}
int findLowest(int a, int b, int c, int d, int e)
{
int low = a;
if ( low > b)
{
b = low;
}
if (low > c)
{
c = low;
}
if (low > d)
{
d = low;
}
if (low > e)
{
e = low;
}
return low;
}