Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Programma per calcolare il massimo tra 2 numeri.
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. main(){
  7.     int x, y, z;
  8.    
  9.     cout << "\nInserire un valore per x\n";
  10.     cin >> x;
  11.     cout << "\nInserire un valore per y\n";
  12.     cin >> y;
  13.     z=x-y;
  14.    
  15.     if (z==0)
  16.         cout <<"/nI due numeri sono uguali\n";
  17.     else if (z>0)
  18.         cout <<"\nIl numero " << x << " e' piu' grande del numero " << y <<"\n";
  19.     else
  20.         cout <<"\nIl numero " << y << " e' piu' grande del numero " << x <<"\n";
  21.     return 1;
  22.        
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement