#include <stdio.h>
#include <math.h>
int main() {
float g1, g2, c1, c2, dismul, cadd, csub, dis;
printf("Enter the latitudes of the places (L1 and L2): ");
scanf("%f %f", &c1 ,&c2);
printf("Enter the longitudes of the places (G1 and G2): ");
scanf("%f %f ", &g1, &g2);
cadd = cos(c1 + c2);
csub = cos(g2-g1);
dismul = cadd * csub;
dis = 3963 * acos(dismul);
printf("The distance between the places is:%f\n", dis);
return 0;
}
I wrote this code to give distance between two points but when I run it, it does not give the last printf
until I type any letter and press enter.