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