diff --git a/lab2-1.c b/lab2-1.c new file mode 100644 index 0000000000000000000000000000000000000000..6eab680f1caf2ebcf648db3fa19f6353ba731be3 --- /dev/null +++ b/lab2-1.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +int calk(){ + int x; + printf("Podaj liczbe calkowita:\n"); + scanf("%i", &x); + return x; +} + +float kolo(){ + float r, pole, obw; + printf("Podaj promien kola:\n"); + scanf("%f", &r); + pole = M_PI*r*r; + obw = 2*M_PI*r; + printf("Pole kola wynosi: %.2f\n", pole); + printf("Obwod kola wynosi: %.2f\n", obw); +} + +float c_to_f(){ + float cels, far; + printf("Podaj temperature w st. Celsjusza:\n"); + scanf("%f", &cels); + far = (cels * 1.8) + 32; + return far; +} + +int main(){ + int x = calk(); + printf("Podana liczba wynosi: %i\n", x); + kolo(); + float far = c_to_f(); + printf("Podana tempertura w Fahrenheitach: %.2f", far); +}