Dear all,
I have a quick question about if-else-if control flow (you'd think by now these questions would be unnecessary, but here I am):
If I was told to rewrite a function that looked like this (this is an exam question so I am not asking the exact question in order to be within the honor code)
#define STUFF
int My_Function(int, int);
void int(main){
... code here
}
int My_Function(int a, int b){
int c = 0;
if( a < b) c = b;
else if (b >= a) c = b;
else c = STUFF;
return c;
}
Issues with this code:
1. No need for the definition
2. No need for two arguments.
3. The else condition is never reached.
4. I could just replace with a one-line function return (input);
So, am I missing anything? Thanks for the help in advance!