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

Lab Work 1

IT1-2202

Aisultan Torebay

1)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float h1,h2,t1,t2,R;

cin >>h1 >>h2 >>t1 >>t2;

R=(h2-h1)*60+(t2-t1);

cout<<"R= " << R;

return 0;

2)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

{
float a, r1,r2,R;

cin >>a;

r1=a*a;

r2=a*a;

R=r1*r2;

cout<<"R= " << R;

return 0;

3)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float a, b, z, x, c, v;

cin >>a >>b;

z=fabs(a-b);

x=a+b;

c=a/b;

v=a*b;

cout<<"z= " << z;

cout<<"x= " << x;


cout<<"c= " << c;

cout<<"v= " << v;

return 0;

4)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float a, b, x, y;

cin >>a >>b;

x=(a*a+b*b)2

y=(fabs(a)+fabs(b))/2

cout<<"x= " << x;

cout<<"y= " << y;

return 0;

5)

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

using namespace std;

int main ()

float v, b, t1, t2, S;

cin >>v >>b >>t1 >>t2;

S=v*t1+(v-b)*t2;

cout<<"S= " << S;

return 0;

6)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float v1, v2, t, S, L;

cin >>v1 >>v2 >>t >>S;

L=S+(v1+v2)*t;

cout<<"L= " << L;

return 0;

}
7)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float a, b, P, S;

cin >>a >>b;

P=a+b+sqrt(a*a+b*b);

S=(a*b)/2;

cout<<"P= " << P;

cout<<"S= " << S;

return 0;

8)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

{
float v1, v2, t, S, L;

cin >>v1 >>v2 >>t >>S;

L=S-(v1+v2)*t;

cout<<"L= " << L;

return 0;

9)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float a, b, c, s, v;

cin >>a ;

b=a;

c=a*a

s=6*c

v=pow(a,3)

cout<<"b= " << b;

cout<<"c= " << c;

cout<<"s= " << s;

cout<<"v= " << v;


return 0;

10)

#include<iostream>

#include<math.h>

using namespace std;

int main ()

float R, L, S;

cin >>R ;

L=2*3.14*R;

S=3.14*R*R;

cout<<"L= " << L;

cout<<"S= " << S;

return 0;

11)

#include <iostream>

#include <math.h>

using namespace std;


int main()

float pi,R1,R2,S;

pi=3.14;

cin>>R1>>R2;

S=abs(pi*R1*R1-pi*R2*R2);

cout<<S;

12)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float a,S,R1,R2;

cin>>a;

S=a*a/2;

R1=a/3;

R2=a;

cout<<S<<"\n"<<R1<<"\n"<<R2;

}
13)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float L,S,R,pi;

pi=3.14;

cin>>L;

R=L/(2*pi);

S=2*pi*R*R;

cout<<S;

14)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float L,S,R,pi;

pi=3.14;
cin>>S;

R=sqrt(S/(2*pi));

L=2*pi*R;

cout<<L;

15)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float S,a,b,q,pi,P,H;

pi=3.14;

cin>>a>>b>>q;

H=((sin(pi/q)*(a-b))/2*cos(pi/q));

S=(a+b)/2*H;

P=(a+b)*2;

cout<<S<<"\n"<<P;

16)
#include <iostream>

#include <math.h>

using namespace std;

int main()

float S,a,b,q,pi,P,H;

pi=3.14;

cin>>a>>b>>q;

H=((sin(pi/q)*(a-b))/cos(pi/q));

S=(a+b)/2*H;

P=(a+b+H+pow(sin(pi/q),2)/cos(pi/q));

cout<<S<<"\n"<<P;

17)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float x1,y1,x2,y2,D;

cin>>x1>>y1>>x2>>y2;

D=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
cout<<D;

18)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float a,b,c,S,V;

cin>>a>>b>>c;

S=a*b;

V=a*b*c;

cout<<S<<"\n"<<V;

19)

#include <iostream>

#include <math.h>

using namespace std;

int main()
{

float R1,R2,R3,Rs;

cin>>R1>>R2>>R3;

Rs=1/R1+1/R2+1/R3;

cout<<Rs;

20)

#include <iostream>

#include <math.h>

using namespace std;

int main()

float a, A, A2, A3, partA,partB,partV;

cin>>a;

A=a*a*a;

A2=a*a;

A3=A2*A2*A2*A2;

partA=A*A*A*a;

partB=A2*A2*A*A*A;

partV=A3*A3*A3*A3*A3*A3;

cout<<partA<<"\n"<<partB<<"\n"<<partV;

You might also like