1.
#include <iostream.h>
#include <conio.h>
void main()
cout<<"Panjang:"<<20<<endl;
cout<<"Lebar:"<<5<<endl;
cout<<"Tinggi:"<<8.7<<endl;
getch();
2.
#include <iostream.h>
#include <conio.h>
void main()
cout<<"huruf "<<"A"<<endl;
cout<<"huruf "<<"B"<<endl;
cout<<"huruf "<<"C"<<endl;
getch();
3.
#include <iostream.h>
#include <conio.h>
void main()
float a, b, c, d, e, f, x, y, z;
cout<<"-----BILANGAN BULAT-----"<<endl;
cin>>a;
cin>>b;
cout<<endl;
cout<<"-----BILANGAN PECAHAN-----"<<endl;
cin>>c;
cin>>d;
cin>>e;
cin>>f;
cout<<endl;
x = a / b;
y = c / d;
z = e / f;
#include <iostream.h>
#include <conio.h>
void main()
float x, y, a, b, c;
a=10;
b=1.5;
c=8;
cout<<endl;
x = a + b + c;
y = a * b * c;
getch();
}
5.
#include <iostream.h>
#include <conio.h>
void main()
int a, b, x, y, z, k, l;
cin>>a;
cin>>b;
x= a + b;
y= a - b;
z= a * b;
k= a / b;
l= a % b;
getch();
}
6.
#include <iostream.h>
#include <conio.h>
#include <math.h>
void main()
phi = 3.14;
cin>>r1;
cin>>t1;
lpt=(2*phi*r1)*(r1+t1);
cout<<endl;
cin>>r2;
cin>>t2;
getch();
}
7.
#include <iostream.h>
#include <conio.h>
void main()
phi = 3.14;
cin>>r1;
cin>>t1;
vt=phi*r1*r1*t1;
cin>>r2;
cin>>t2;
vk = (phi)/3 * r2 * r2 * t2;
getch();
}
8.
#include <iostream.h>
#include <conio.h>
#include <math.h>
void main()
phi = 3.14;
cin>>r1;
cin>>t1;
lpt=(2*phi*r1)*(r1+t1);
cin>>r2;
cin>>t2;
cout<<endl;
cout<<"MAKA :"<<endl;
cout<<"NILAI TERBESAR DAN TERKECIL DARI LUAS PERMUKAAN TABUNG DAN KERUCUT"<<endl;
cout<<endl;
terbesar=lpt>lpk ? lpt:lpk;
terkecil=lpt<lpk ? lpt:lpk;
getch();
}
9.
#include <iostream.h>
#include <conio.h>
void main()
phi = 3.14;
cin>>r1;
cin>>t1;
vt=phi*r1*r1*t1;
cin>>r2;
cin>>t2;
vk = (phi)/3 * r2 * r2 * t2;
cout<<endl;
cout<<"MAKA :"<<endl;
cout<<"VOLUME TABUNG="<<vt<<endl;
cout<<"VOLUME KERUCUT="<<vk<<endl;
cout<<endl;
cout<<endl;
terbesar=vt>vk ? vt:vk;
terkecil=vt<vk ? vt:vk;
getch();
10.
#include <iostream.h>
#include <conio.h>
#include <math.h>
void main()
int a, b, c;
cin>>a;
cin>>b;
c = sqrt(pow(a,2)+pow(b,2));
getch();
}
11.
#include <iostream.h>
#include <conio.h>
void main()
cin>>F;
cin>>R;
CF = 5 * ( F - 32 )/9;
CR = 5 * R / 4;
getch();
}
12.
#include <iostream.h>
#include <conio.h>
void main()
cin>>J;
cin>>M;
cin>>D;
DJ = J * 3600;
DM = M * 60 ;
DD = D * 1 ;
DT = DJ + DM + DD;
getch();
13.
#include <iostream.h>
#include <conio.h>
void main()
cin>>x;
cin>>y;
cin>>z;
p=x>y ? x:y;
q=p>z ? p:z;
cout<<endl;
r=x<y ? x:y;
s=r<z ? r:z;
getch();
}
14.
#include <iostream.h>
#include <conio.h>
void main()
int Semester;
float IPK;
cout<<"Nama:";
cin>>Nama;
cout<<"Alamat:";
cin>>Alamat;
cout<<"NIM:";
cin>>NIM;
cout<<"Semester:";
cin>>Semester;
cout<<"IPK:";
cin>>IPK;
getch();
}
15.
#include <iostream.h>
#include <conio.h>
void main()
getch();