More about Parameters
Multiple parameters can also be used if you want to make math calculations or describe some logic. For example, we want to write the function which will write the average of 2 numbers (sum of numbers divided by its count):
1234567891011// Declaration of the function, which calculates the mean of 2 numbers void avr(int a, int b) { cout << (a+b)/2 << endl; } int main() { // Call the function to be executed avr(4, 8); avr(3, 5); return 0; }
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 4. Capítulo 4
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Suggested prompts:
Pregunte me preguntas sobre este tema
Resumir este capítulo
Mostrar ejemplos del mundo real
Awesome!
Completion rate improved to 2.94
More about Parameters
Desliza para mostrar el menú
Multiple parameters can also be used if you want to make math calculations or describe some logic. For example, we want to write the function which will write the average of 2 numbers (sum of numbers divided by its count):
1234567891011// Declaration of the function, which calculates the mean of 2 numbers void avr(int a, int b) { cout << (a+b)/2 << endl; } int main() { // Call the function to be executed avr(4, 8); avr(3, 5); return 0; }
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 4. Capítulo 4