Advertisement
peterzig

Pole i Obwód koła

Oct 21st, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1. // poleobwodkolo.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <conio.h>
  6. #define _USE_MATH_DEFINES
  7. #include <math.h>
  8.  
  9.  
  10. int main()
  11. {  
  12.     float r, y, z;
  13.     M_PI;
  14.     printf("+-----------------------------------------+\n");
  15.     printf("|  Program obliczajacy pole i obwod kola  |\n");
  16.     printf("|                        made by Peterzig |\n");
  17.     printf("+-----------------------------------------+\n");
  18.     printf("Podaj promien kola r = ");
  19.     scanf("%f", &r);
  20.     y = M_PI*r*r;
  21.     z = 2 * M_PI*r;
  22.     printf("+--------------------------------+\n");
  23.     printf("|       Pole     |      Obwod    |\n");
  24.     printf("+--------------------------------+\n");
  25.     printf("|           %5.3f|          %5.3f|\n", y,z );
  26.     printf("+--------------------------------+\n");
  27.     _getch();
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement