I have two variable for graph one is value and other is value1 i want that int max should get the value of those variable which has maximum values like if value=50 and value1=100 then max=value1
appDelegate=[[UIApplication sharedApplication]delegate];
int value3=[appDelegate.oneGlobal intValue];
int value4=[appDelegate.twoGlobal intValue];
int value5=[appDelegate.threeGlobal intValue];
int max;
if (value3>value4) {
max=value3;
}
else if(value3>value5){
max=value3;
}
else if(value4>value3){
max=value4;
}
else if(value4>value5){
max=value4;
}
else{
max=value5;
}
Delete all your
if-statementsand add the following to your code:That would do the trick.
Hope it helps