You are on page 1of 1

#include <iostream>

using namespace std;

void main() {
int numero, numP;
float variable;
cout << "introduzca un numero entero positivo o negativo" << endl;
cin >> numero;

if (numero > 0) {
cout << "el numero es positivo" << endl;
}

else {
cout << "el numero es negativo" << endl;
}

if (numero % 2 == 0) {
cout << "el numero es impar" << endl;
}
else {
cout << "el numero es impar" << endl;

cout << "elija una opcion a realizar" << endl;


cout << "1. se incrementa en 2" << endl;
cout << "2. se incrementa en 8" << endl;
cout << "3. se incrementa en catorce" << endl;

cin >> numP;

switch (numP) {
case 1: {
numP = numero + 2;
cout << "el numero da:" << numP;
break;
}
case 2: {
numP = numero + 8;
cout << "el numero da:" << numP;
break;
}
case 3: {
numP = numero + 14;
cout << "el numero da:" << numP;
break;
}

default:
cout << "ingrese una opción válida";
break;

}//switch
system("PAUSE");
}

You might also like