Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Combustion de Alcanos
- // Ajusta w CnHn+2 + x O2 ---> y H2O + z CO2
- #include <iostream.h>
- int main(){
- int n, w, x, y, z;
- do{
- cout << " \n Introduce el numero de carbonos de tu alcano: ";
- cin >> n;
- if( n%2==0 ) w=2;
- else w=1;
- z=w*n;
- y=w*(n+1);
- if( n%2==0 ) x=3*n+1;
- else x=(y+(2*z))/2;
- cout << " " << w << " C" << n << "H" << 2*n+2 << " + " << x << " O2 ---> " << y << " H2O + " << z << " CO2 \n";
- }while( n>0 );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement