P011.c (441B)
1 /* The time period of a simple pendulam is 2 given by the formula : 3 t = 2 * pi * square_root(l / g) 4 WAP to calculate T take length(L) and gravity 5 as input 6 */ 7 8 #include<stdio.h> 9 #include<math.h> 10 int main() { 11 double l, g, t; 12 printf("Enter the Length and Gravity measures : "); 13 scanf("%lf %lf", &l, &g); 14 t = 2 * M_PI * sqrt(l / g); 15 // using M_PI variable for PI value from math.h header file 16 printf("\nTime Period : %lf", t); 17 return 0; 18 }