EVAP 4


Trabajo de Prezi 


<Iframe frameborder = "0" webkitallowfullscreen = "" mozallowfullscreen = "" allowFullScreen = "" width = "" height = "400 600" src="http://prezi.com/embed/-bjd5cjsigqx/?bgcolor=ffffff&lock_to_path=0&autoplay=0&autohide_ctrls=0#"></iframe>




# Include <iostream> # Include <math.h> using namespace std; int main () { // 1) DECLARACION int opcion; cout << "MENU ******** DE TERMODINAMICA ******** \ n \ n"; cout << "1) SUMA DE NUMEROS \ n"; cout << "2) SUMA DE Impares \ n"; cout << "3) SUMA DE PARES \ n"; cout << "4) factoriales \ n"; cout << "5) SERIE \ n";

switch (opcion) { case 1: { cout << "******** SUMA DE NUMEROS ******************* \ n \ n"; int Suma, num, i; Char SN; cout << "suma = suma + num \ n \ n"; cout << "NUMERO ingresar ¿DESEA UN <S / N>:"; cin >> SN; Suma = 0; // Neutro Aditivo while (SN == 'S') { cout << "Ingrese el NUMERO:"; cin >> num; Suma = Suma + num; cout << "NUMERO ingresar ¿DESEA UN <S / N>:"; cin >> SN; } // FIN DEL MIENTRAS cout << "LA SUMA DE LOS NUMEROS ES:" << endl << Suma; cout << "******************************************** \ n \ n "; } break; case 2: { cout << "******** SUMA DE Impares ******************* \ n \ n"; int Suma, num, i, n; Char SN; cout << "2 * n - 1 \ n \ n"; cout << "ingresar EL NUMERO DE TERMINO IMPAR A SUMAR:"; cin >> n; Suma = 0; // Neutro Aditivo i = 1; // Inicialización while (i <= n) { Suma = Suma + (2 * i - 1); i = i + 1; } // FIN DEL MIENTRAS cout << "LA SUMA DE LOS PRIMEROS" << n << "numeros impares ES:" << endl << Suma; cout << "********************************************** **** \ n \ n "; } break; case 3: { cout << "******** SUMA DE PARES ******************* \ n \ n"; int Suma, num, i, n; cout << "2 * n \ n \ n"; cout << "ingresar EL NUMERO DE TERMINO PAR A SUMAR:"; cin >> n; Suma = 0; // Neutro Aditivo i = 1; // Inicialización while (i <= n) { Suma = Suma + (2 * i); cout << "LA SUMA DE LOS PRIMEROS" << i << "NUMEROS PARES ES:" << endl << Suma; i = i + 1; } // FIN DEL MIENTRAS cout << "LA SUMA DE LOS PRIMEROS" << n << "NUMEROS PARES ES:" << endl << Suma; cout << "************************************* \ n \ n"; } break; Caso 4: { cout << "factoriales ******** ******************* \ n \ n"; int hecho, i, n; cout << "made = made ​​* n \ n \ n "; cout << "ingresar EL factorial DE:"; cin >> n; hecho = 1; // Neutro multiplicativo i = 1; // Inicialización while (i <= n) { hecho = hecho * i; cout << "EL FACTORIAL DE" << i << "ES:" << endl << hecho; i = i + 1; } // FIN DEL MIENTRAS cout << "EL FACTORIAL DE" << n << "ES:" << endl << hecho; cout << "************************************* \ n \ n"; } // FIN DEL CASO 4 break; Caso 5: { cout << "******** SERIE ******************* \ n \ n"; int i, n, suma flotador; cout << "n / ((n + 1) (n + 1)) \ n \ n"; cout << "ingresar EL TERMINO DE LA SERIE A SUMAR:"; cin >> n; suma = 0; // Neutro multiplicativo i = 1; // Inicialización while (i <= n) { suma = suma * i / (pow (i + 1,2)); cout << "EL DE termino" << i << "ACUMULADO ES:" << suma << endl; i = i + 1; } // FIN DEL MIENTRAS cout << "EL TERMINO" << n << "DE LA SERIE ES:" << suma << endl; cout << "************************************* \ n \ n"; } // FIN DEL CASO 5 break;


} // FIN DEL INTERRUPTOR cout << endl; cout << "\ n"; Sistema ("pause"); return 0; } // FIN DEL PROGRAMA

No hay comentarios:

Publicar un comentario