Chosen

Bugged shit.

Jun 18th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a; // Globally copying it here because I don't feel like cluttering int main up even more.
  6. int b; //
  7. int c; //
  8.  
  9. int dividemultiply (int a, int b=2, int c=4) //
  10. {
  11.   int r;
  12.   r=a/b*c;
  13.   return (r);
  14. }
  15.  
  16. int main ()
  17. {
  18.   cout << "Input a number.\n";
  19.   cin >> a; //It always crashes after you put a number in... No idea why.
  20.   cout << dividemultiply (a,14,c); //A is supposed to be defined by the line above. C is supposed to be defined by line 9.
  21.   cout << endl;
  22.   cout << dividemultiply (a,b,2); //A is supposed to be defined by line 19. B is supposed to be defined by line 9.
  23.   return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment