View Single Post
  #1  
Old 01-03-2011, 02:21 PM
bonfire's Avatar
bonfire bonfire is offline
M.Arsalan Qureshi

 
Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to enter velocity, acceleration and time and print final velocity

Program to enter velocity, acceleration and time and print final velocity using the formula : v = u + a * t


#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
int v,u,a,t;
cout << "Enter the velocity, acceleration, time as integers : " << endl;
cin>>u>>a>>t;
v=u+a*t;
cout << "The final velocity is " << v << "." << endl;
getch();
}
This program takes in the velocity, acceleration and the time as a screen input from the user.
The final velocity is calculated using the formula v = u + a * t, and then outputted using the 'cout' command.

Sample Input
20 10 5
Sample Output
The final velocity is 70.
__________________

Reply With Quote