Advertisement
fcamuso

Corso Recupero - 1

Jun 17th, 2021
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.   //DICHIARAZIONE DELLE VARIABILI NECESSARIE
  8.   //base
  9.   int base = 0; //inizializzare
  10.   int altezza = 0;
  11.  
  12.   int area =0;
  13.  
  14.   //ELABORAZIONE
  15.  
  16.   base = 5;
  17.   altezza = 4;
  18.   area = base*altezza/2;
  19.  
  20.   //OUTPUT
  21.   cout << area << endl;
  22.  
  23.   //PROVATE A ...
  24.   //lasciare a zero solo la base
  25.   //lasciare a zero solo altezza
  26.   //lasciare a zero base e altezza
  27.   //base un valore pari e altezza un valore dispari
  28.   //base o altezza un valore con la virgola (lo accetta??)
  29.   //base o altezza con valore negativo
  30.   //base o altezza con valori MOLTO grandi (già quanto grandi possono poi diventare??)
  31.  
  32.         return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement