Assignment # 1 Muhammad Shazib Computer Programming BSCE02203153 Submitted To: Sir Shehzad

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Assignment # 1

Muhammad Shazib
Computer programming
BSCE02203153
Submitted to: Sir Shehzad
1. Vf= Vi+at
Input:
#include<iostream>
using namespace std;
main()
{
float v1,v2,a,t;
//vf=vi+at
cout<<"Enter the Initial Velocity:";
cin>>v1;
cout<<"Enter the acceleration:";
cin>>a;
cout<<"Enter the time:";
cin>>t;
v2=v1+a*t;
cout<<"Final Velocity::"<<v2;
}

Output:
2. Vi= Vf-at

Input:
#include<iostream>
using namespace std;
main()
{
float v1,v2,a,t;
//vi=vf-at
cout<<"Enter the Final Velocity:";
cin>>v2;
cout<<"Enter the acceleration:";
cin>>a;
cout<<"Enter the time:";
cin>>t;
v1=v2-a*t;
cout<<"Initial Velocity::"<<v1;
}
Output:
3. a=vf-vi/t

Input:
#include<iostream>
using namespace std;
main()
{
float v1,v2,a,t,c;
//a=vf-vi/t
cout<<"Enter the Final Velocity:";
cin>>v2;
cout<<"Enter the Initial Velocity:";
cin>>v1;
cout<<"Enter the time:";
cin>>t;
c=v2-v1;
cout<<"Aceeleration::"<<c/t;
}

Output:
4. t=vf-vi/a

Input:
#include<iostream>
using namespace std;
main()
{
float v1,v2,a,t,c;
//t=vf-vi/a
cout<<"Enter the Final Velocity:";
cin>>v2;
cout<<"Enter the Initial Velocity:";
cin>>v1;
cout<<"Enter the acceleration:";
cin>>a;
c=v2-v1;
cout<<"Time::"<<c/a;
}

Output:

You might also like