Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: dif.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c;
- cout << "Diferencia" << endl;
- cout << "==========" << endl;
- cout << "Ingresar 3 numeros= "; cin >> a >> b >> c;
- cout << "La diferencia del mayor menos el menor es ";
- if(a>=b && b>=c) cout << a - c;
- else if(a>=c && c>=b) cout << a - b;
- else if(b>=a && a>=c) cout << b - c;
- else if(b>=c && c>=a) cout << b - a;
- else if(c>=a && a>=b) cout << c - b;
- else cout << c - a;
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement