Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite0
i cant figure this out
Rearrange the code to declare a function taking two integer and one char parameters. If char's value is "+", return the sum of the integer arguments. Otherwise, return the product of their multiplication. return a * b; int foo(int a, int b, char c) { return a + b; } } if (c == '+') {
1 Réponse
+ 3
int foo(int a, int b, char c) {
if (c == '+') {
return a + b; }
return a * b;
}
By default it will return a * b, unless c == '+'.