Skip to content

p011.c

Problem Statement

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

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#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;
}