1 /*
2 Copyright (C) 2009 Alessandro Bugatti (alessandro.bugatti@istruzione.it)
3 3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 18
19 /*! \file
20 * \brief Calcola l'area e il perimetro di un rettangolo
21 * \author Alessandro Bugatti
22 * \version 0.1
23 * \date Creazione 28/09/2009
24 * \date Ultima modifica 28/09/2009
25 */
26 26
27 #include <stdio.h>
28 #include <stdlib.h>
29 29
30 int main()
31 {
32 float base, altezza;
33 float perimetro, area;
34 printf("Inserisci la base: ");
35 scanf("%f",&base);
36 printf("Inserisci l'altezza: ");
37 scanf("%f",&altezza);
38 perimetro = (base + altezza)*2;
39 area = base*altezza;
40 printf("Il perimetro del rettangolo e' %f e la sua area e' %f",perimetro, area);
41 return 0;
42 }
43