GJPassos

APS 01 EX 02 ALGORITMOS 02

May 15th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. //APS 01 EX 02
  2. //ALGORITMOS 02 PROF MALGARETE - CENTRO TECNOLOGICO UNIVERSIDADE POSITIVO
  3. //GILMAR JUNIOR DOS PASSOS
  4.  
  5. #include "stdlib.h"
  6.  #include "conio.h"
  7.  #include "stdio.h"
  8.  #include "string.h"
  9.  #include "locale.h"
  10.  
  11. void main()
  12. {
  13.     setlocale(LC_ALL, "Portuguese");
  14.  
  15.     float base1=0, base2=0, altura=0, area=0;
  16.  
  17.         printf ("Qual o valor da base menor do trapézio:\n");
  18.         scanf ("%f",&base1);
  19.  
  20.         printf ("Qual o valor da base maior do trapézio:\n");
  21.         scanf ("%f",&base2);
  22.  
  23.         printf ("Qual o valor da altura do trapézio:\n");
  24.         scanf ("%f",&altura);
  25.  
  26.         area = ((base1+base2)*altura) / 2;
  27.  
  28.         printf ("A área do trapézio é:\n");
  29.         printf ("%.2f",area);
  30.  
  31.         getch();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment