Professional Documents
Culture Documents
Functions are a bunch of statements grouped together. A 4 int sum=a;
function is provided with zero or more arguments, and it 5
6 if(b>sum){
executes the statements on it. Based on the return type, it 7 sum=b;}
either returns nothing (void) or something. 8 if(c>sum){
9 sum=c;}
You have successfully solved Functions in C Share Tweet
10 if(d>sum){
You are now 285 points away from
A sample syntax for a function is 11 the gold level for your c badge.
sum=d;
Submissions
12 }return sum;}
Try the next
13 challenge
int main() {
return_type function_name(arg_type_1 a 14 int a, b, c, d;
... 15 scanf("%d %d %d %d", &a, &b, &c, &d);
... 16 int ans = max_of_four(a, b, c, d);
... 17 printf("%d", ans);
Problem [if return_type
Submissionsis non void]Leaderboard Editorial
18 return 0;}
return something of type `retu
} Line: 8 Col: 15
Leaderboard
sum += b;
sum += c;
Congratulations
You solved this challenge. Would you like to Next Challenge
sum += d;
return sum; challenge your friends?
}
Test case 0
Compiler Message
Editorial