PPS Practical 7

PPS Practical 7
  • Aim: Write a C program to find out distance travelled by the equation d = ut + at^2.
  • Code:
    //For turbo C++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
        float u,t,a,d;
        //clrscr();
        printf("Enter u : ");
        scanf("%f",&u);
        printf("Enter a : ");
        scanf("%f",&a);
        printf("Enter t : ");
        scanf("%f",&t);
        d=u*t+a*t*t;	//given in question
        printf("distance : %.2f\n",d);
        //getch();
    }
  • Output:
  • Output of practical 7

Comments