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 in C
- Discussions
Functions in C
Functions in C
Sort by
recency
|
841 Discussions
|
Please Login in order to post a comment
Functions in C are essential for writing modular, reusable, and organized code. Sky1exch login
include
/* Add
int max_of_four(int a, int b, int c, int d)
here. */ int max_of_four(int a,int b,int c,int d) { int res=a>b?a:b; int res1=res>c?res:c; int res2=res1>d?res1:d; return res2; }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);
}
include
/* Add
int max_of_four(int a, int b, int c, int d)
here. */ int max_of_four(int a,int b,int c,int d) { int res=a>b?a:b; int res1=res>c?res:c; int res2=res1>d?res1:d; return res2; }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);
}
Less Code: