Tuesday, 4 October 2016

Program to find Speed of an object if Distance and Time is given .

#include<iostream.h>
#include<conio.h>
void main ()
{
clrscr ();
float a,b,c;
cout<<“Enter the distance travelled (in metres) “;
cin>>a;
cout<<“Enter the total time taken (in seconds) “;
cin>>b;
c=a/b;
cout<<“Speed of the object is “<<c<<“m/s”;
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...