We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Introduction
- Functions
- Discussions
Functions
Functions
Sort by
recency
|
2015 Discussions
|
Please Login in order to post a comment
int max_of_four(int a, int b, int c, int d) { int maxValue,temp1,temp2 = 0; temp1 = a>b?a:b; temp2 = c>d?c:d; return maxValue = temp1>temp2?temp1:temp2; }
int max_of_four(int a, int b, int c,int d){
} int main() {
}
include
include
using namespace std;
/* Add
int max_of_four(int a, int b, int c, int d)here. */ int max2(int a, int b){ if (a >b) return a; else return b; } int max_of_four(int a, int b, int c, int d){ return max2(max2(a,b), max2(c,d)); }int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int ans = max_of_four(a, b, c, d); printf("%d", ans);
}