Alguien me puede ayudar? Que he de cambiar en las líneas a modificar? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Alguien me puede ayudar? Que he de cambiar en las líneas a modificar?

#include <iostream> using namespace std; /* DECLARACION DE LOS PROTOTIPOS DE LAS FUNCIONES*/ bool EsPar ( ); // linea a modificar /*CODIFICACIÓN DE LA FUNCIÓN PRINCIPAL (MAIN)*/ int main (void) { int valor_leido; cout << "Introduce un valor: "; cin >> valor_leido; if (EsPar ( ) ) // linea a modificar cout << "El numero introducido es par.\n"; else cout << "El numero introducito NO es par.\n"; return 0; } /* * Esta funcion determinar si un valor pasado como * parametro es par o no. * * Devuelve true si el valor es par y * false si el valor NO es par */ void EsPar ( ) // linea a modificar { if (valor % 2 == 0) res = true; else res = false; return res; }

12th Nov 2019, 8:49 PM
Sergio
1 Answer
0
void EsPar ( ) // linea a modificar Currently this function is returning void is should return a bool bool EsPar() Also it does not have parameters, which is good practice is you want to evaluate values bool EsPar(int valor) Keep going. Please try to use the playground when sharing code.
12th Nov 2019, 9:05 PM
sneeze
sneeze - avatar