i have a problem max_value

hi my problem is that it say that my max_value is undefined why?

#include <iostream>
#include <cmath>
#include "graph1.h"

using namespace std;

int main(void)
{
//Variable Declaration/Initialization
int choice;
int a=0;
int b=0;
int c=0;
int d=0;

//Display graphics window
displayGraphics();

//promt the user to input
cout << "Insert 4 Numbers" << endl;
cin >> a;
cin >> b;
cin >> c;
cin >> d;

//if else statement
if (a > b)
{
max_value = a;

else
max_value = b;
}

return 0;
}

the other question is that like you see in the code i have 4 cin so i need to do max and min value for those 4 integers and determines the minimum and maximum values of these integers i can do it for 2 but how i do that for all of them? thank you
Read this so that you can properly code the cin statement.
http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.3

Moreover, consider using a loop and an array of 4 elements. Then read the following to links on max_element and min_element. Don't be intimidated by the algorithms. They are very simple to use with arrays.
http://cplusplus.com/reference/algorithm/max_element/
http://cplusplus.com/reference/algorithm/min_element/

Topic archived. No new replies allowed.