Sunday, 6 March 2016

PROGRAMME TO FIND KINEMATICS TO PRINT FINAL VELOCITY AND DISTANCE



#include<stdio.h>
main()
{
int u,a,t,v;
float s;
printf("Enter the initial velocity,acceleration,time");
scanf("%d%d%d",&u,&a,&t);
v=u+(a*t);
s=u*t+(0.5*a*t*t);
printf("Final velocity=%d Distance travelled=%f",v,s);
}

ASSIGNMENT NO 1)

TO DEMONSTRATE THE USE OF DATA TYPES, SIMPLE OPERATORS AND EXPRESSIONS

You should read following topics before starting this exercise

      1.
Problem solving steps – writing algorithms and flowcharts.
2. Different basic data types in C and rules of declaring variables in C.
3. Different operators and operator symbol.

4. How to construct expressions in C, operator precedence.

No comments:

Post a Comment