InfLab1/prog1.c
2024-11-30 12:48:00 +04:00

18 lines
505 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <stdio.h>
#include <stdlib.h>
#include "progs.h"
#define G 6.67E-11
void prog1(){
double m1, m2, r, force;
printf("Программа приближённо рассчитает силу притяжения двух тел.\n Введите данные.\n");
printf("m1: "); scanf("%lf", &m1);
printf("m2: "); scanf("%lf", &m2);
printf("R: "); scanf("%lf", &r);
force=(G*m1*m2/(r*r));
printf("Сила притяжения приблизительно равна %lfН\n", force);
}