Professional Documents
Culture Documents
Denis Akbar
0651-13-121
VOLUME TABUNG
PROGRAM :
#include<iostream.h>
void tab_bung();
void tab_bung()
{
int d,e;
float n;
cin>>e;
n=3.14*d*d*e;
void main ()
{
tab_bung ();
}
PROGRAM RUNNING
ALGORITMA :
PROGRAM :
#include<iostream.h>
float hasil (int u, int n);
void main ()
{
int d,e;
float n;
cout<<"
| Denis Akbar | 0651 - 13 - 121 |"<<endl<<endl;
cout<<"Masukan Nilai Jari - Jari : ";
cin>>d;
cout<<"Masukan Nilai Tinggi : ";
cin>>e;
n=hasil(d,e);
cout<<"Volume Tabungnnya Adalah : ";
cout<<n;
}
float hasil (int u, int n)
{
return (3.14*u*u*n);
}
PROGRAM RUNNING :
ARAY
ARAY 1 DIMENSI
ALGORITMA :
Int d[2][4]={5,6,7,8,8,4,4,7}
Int e[2][4]
For n=0 to 1 do
For s=0 to 3 do
e [n][s]=d[n][s]*4
end for s
end for n
PROGRAM :
#include <iostream.h>
void main ()
{
cout<<"
int d[2][4]={5,6,7,8,8,4,4,7},e,n;
for (e=0;e<=1;e++)
{
for (n=0;n<=3;n++)
{
cout<<d[e][n]*4<<" ";
}
}
}
PROGRAM RUNNING :
ARAY 1 DIMENSI
ALGORITMA :
int d[3][3]={0,0,0,2,0,0,2,2,0};
int e,n,s, tampil;
e=0
tampil=0
For n=0 to 2
For s=0 to 2
if(d[n][s]-0
tampil++;
e= d[n][s];
End if
End for n
End for s
Print e
Print tampil
PROGRAM :
#include<iostream.h>
void main ()
{
int d[3][3]={0,0,0,2,0,0,2,2,0};
int e,n,s, tampil;
e=0;
tampil=0;
cout<<"
{
for (s=0;s<=2;s++)
{
if(d[n][s]-0)
{
tampil++;
}
e= d[n][s];
cout<<e<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"Pada Matriks Diatas Mempunyai Nilai 2 : ("<<tampil<<")";
}
PROGRAM RUNNING :