Advertisement
Kyrexar

Combustión de Alcanos

Jun 6th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. // Combustion de Alcanos
  2. // Ajusta w CnHn+2 + x O2 ---> y H2O + z CO2
  3.  
  4. #include <iostream.h>
  5.  
  6. int main(){
  7.     int n, w, x, y, z;
  8.  
  9.     do{
  10.         cout << " \n Introduce el numero de carbonos de tu alcano: ";
  11.         cin >> n;
  12.  
  13.         if( n%2==0 ) w=2;    
  14.         else w=1;
  15.  
  16.         z=w*n;
  17.         y=w*(n+1);
  18.  
  19.         if( n%2==0 ) x=3*n+1;
  20.         else x=(y+(2*z))/2;
  21.  
  22.         cout << " " << w << " C" << n << "H" << 2*n+2 << " + " << x << " O2 ---> " << y << " H2O + " << z << " CO2 \n";
  23.     }while( n>0 );
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement