Write a C program to find out distance travelled by the equation d = ut + at^2

 GTU Programming for Problem Solving Practical-7

/*
7. Write a C program to find out distance traveled by the equation d = ut + at^2
*/

#include<stdio.h>

int main()
{
    float u,a,d;
    int t;
    
    printf("\nEnter the value of a : ");
    scanf("%f",&a);

    printf("\nEnter the value of u : ");
    scanf("%f",&u);

    printf("\nEnter the value of t : ");
    scanf("%d",&t);

    d = (u * t) + (a * t * t)/2;
    
    printf("\n The Distance : %f",d);

    return 0;
}

Post a Comment

0 Comments