Generation

generate functionMon, 15 May 2023

Realitza un programa en bash que determine i indique si un nombre és parell o imparell. El nombre el pots passar tant per referència com preguntar-lo durant l'execució.

#include <iostream> int main() { int numero; std::cout << "Entra un numero: "; std::cin >> numero; if ( numero % 2 == 0 ) std::cout << numero << " es parell." << std::endl; else std::cout << numero << " es imparell." << std::endl; return 0; }

Want to kickstart your project?Use the new AI Studio to create your code