Write a c program to evaluate a=(v-u)/t?
How do you end a c program starting with #include %26lt;stdio.h%26gt;?
How do you end a c program starting with #include %26lt;stdio.h%26gt;?
#include%26lt;stdio.h%26gt;
void main(){
float v,u,t;
float a=0;
printf("enter initial velocity: ");
scanf("%f",%26amp;u);
printf("enter final velocity: ");
scanf("%f",%26amp;v);
printf("enter the time: ");
scanf("%f",%26amp;t);
if(t!=0)
a = (v-u)/t;
printf("accelaration = %f",a);
}
Reply:#include%26lt;stdio.h%26gt;
void main()
{
int v,u,t,a;
printf("enter initial velocity,final velocity and time");
scanf("%d%d%d",%26amp;u,%26amp;v,%26amp;t);
a=(v-u)/t;
printf("accelaration = %d",a);
}
cvs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment