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;
}
Comments
Leave a comment