Friday, 13 July 2018

Distance covered in nth second

===========================================================================
                                CODING



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

void main()
{
clrscr();

double u,a,S;
int n;
cout<<"\n Distance covered in nth sec.:- \n Enter the initial velocity: ";
cin>>u;
cout<<"\n Enter acceleration: ";
cin>>a;
cout<<"\n Enter the nth second: ";
cin>>n;
S=u+a/2*(2*n-1);
cout<<"\n The Distance covered is:- "<<S;

getch();
}


===========================================================================


                                OUTPUT



No comments:

Post a Comment