# Thread: Finding the lowest number

1. ## Finding the lowest number

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;
}```

2. All of your lines like b = low; are backwards. They should be like low = b;.

3. That was it thank you very much. Surprising how something as simple as that can mess a whole program up lol. Thanks again!!

4. Originally Posted by jonesk1978
Surprising how something as simple as that can mess a whole program up lol.
That's why you spent 70% of your time debugging, rather than writing code...