P011.c (578B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* The time period of a simple pendulam is 8 given by the formula : 9 t = 2 * pi * square_root(l / g) 10 WAP to calculate T take length(L) and gravity 11 as input 12 */ 13 14 #include<stdio.h> 15 #include<math.h> 16 int main() { 17 double l, g, t; 18 printf("Enter the Length and Gravity measures : "); 19 scanf("%lf %lf", &l, &g); 20 t = 2 * M_PI * sqrt(l / g); 21 // using M_PI variable for PI value from math.h header file 22 printf("\nTime Period : %lf", t); 23 return 0; 24 }