Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int a, b, c, medio;
- cout << "Ingrese tres numeros: ";
- cin >> a >> b >> c;
- if (a>b && b>c) {
- medio=b;
- }
- else {
- if (a>b) {
- if (a>c) {
- medio=c;
- }
- else {
- medio=a;
- }
- }
- else {
- if (b>c) {
- if (a>c) {
- medio=a;
- }
- else {
- medio=c;
- }
- }
- else {
- medio=b;
- }
- }
- }
- cout << "El numero del medio es: " << medio;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement