Anderson Pozo

Generation

generate functionMon, 24 Jul 2023

Hacer un programa para ingresar cinco números y listar cuántos de esos cinco números son positivos.

#include <iostream> using namespace std; int main() { int a, b, c, d, e; cout << "Enter five numbers: " << endl; cin >> a; cin >> b; cin >> c; cin >> d; cin >> e; cout << "The numbers are " << a << ", " << b << ", " << c << ", " << d << ", " << e << endl; if (a > 0) { cout << "The number " << a << " is positive" << endl; } if (b > 0) { cout << "The number " << b << " is positive" << endl; } if (c > 0) { cout << "The number " << c << " is positive" << endl; } if (d > 0) { cout << "The number " << d << " is positive" << endl; } if (e

Questions about programming?Chat with your personal AI assistant