Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 1.14 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Basic If/Else if in C  
  2. float a, b, c, d, e;
  3.  
  4. if (a > 0 && b > 0)
  5.     cout << "blah blah";
  6. else if (a > 0)
  7.     cout << "blah blah a";
  8. else if (b > 0)
  9.     cout << "blah blah b";
  10.  
  11.  
  12. if (c > 0 && d > 0)
  13.     cout << "wowww";
  14. else if (c > 0)
  15.     cout << woww c";
  16. else if (d > 0)
  17.     cout << wowww d";
  18.        
  19. float a, b, c, d, e;
  20.  
  21.     if (a > 0 && b > 0)
  22.         cout << "blah blah" ;
  23.     else if (a > 0)
  24.         cout << "blah blah a" ;
  25.     else if (b > 0)
  26.          cout << "blah blah b" ;
  27.  
  28.  
  29.     if (c > 0 && d > 0)
  30.         cout << "wowww" ;
  31.     else if (c > 0)
  32.         cout << "woww c" ;
  33.     else if (d > 0)
  34.         cout << "wowww d" ;
  35.        
  36. float a, b, c, d, e;
  37.  
  38.  if (a > 0 && b > 0) cout << "blah blah" ; else if (a > 0) cout << "blah blah a" ; else if (b > 0) cout << "blah blah b" ;
  39.  
  40.  if (c > 0 && d > 0) cout << "wowww" ; else if (c > 0) cout << "woww c" ; else if (d > 0) cout << "wowww d" ;
  41.        
  42. float a, b, c, d, e;
  43.  
  44. if (a > 0 && b > 0)  cout << "blah blah";
  45. else if (a > 0)      cout << "blah blah a";
  46. else if (b > 0)      cout << "blah blah b";
  47.  
  48. if (c > 0 && d > 0)  cout << "wowww";
  49. else if (c > 0)      cout << "woww c";
  50. else if (d > 0)      cout << "wowww d";