Answer to Question #274144 in C for Sparrow

Question #274144
  • Code a C program to calculate and distance covered by a car using pointer when time, velocity and acceleration is given. Function Distance () must take time, speed, and acceleration as parameters and return distance.
  • The C program must also take input from the user.
1
Expert's answer
2021-12-02T00:35:18-0500


#include <stdio.h>
int distance(int time1, int speed, int acceleration){
    return (time1*speed*acceleration);
}
int main()
{
    int t=2;
    int s=50;
    int a=20;
    
    printf("Distance = %d",distance(t,s,a));


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS