/*nama kelompok: apip(12150005)
hadiansyah ade gunawan(12150617)
miftakhul anam(12155442)
afip fatkhurochim(12156207)
aditya sanjaya:agung sugiarto(12150269)*/
#include <iostream>
using namespace std;
int main()
{
int i, j;
typedef int MATRIX32[3][2];
MATRIX32 A, B, C;
cout<<"MATRIK A"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"A["<<i<<"]["<<j<<"] : "; cin>>A[i][j];
}
}
cout<<endl;
cout<<"MATRIK B"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"B["<<i<<"]["<<j<<"] : "; cin>>B[i][j];
}
}
cout<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
C[i][j] = A[i][j] + B[i][j];
}
}
cout<<"MATRIK C = A+B"<<endl;
for (i=0; i<3; i++)
{
for (j=0; j<2; j++)
{
cout<<"C["<<i<<"]["<<j<<"] : "<<C[i][j]<<endl;
}
}
return 0;
}
Selasa, 01 Desember 2015
BELAJAR C++ MENCARI NILAI MIN&MAX
/*-(12150005)
-hadiansyah ade gunawan(12150617)
-miftakhul anam(12155442)
-afip fatkhurochim(12156207)
-aditya sanjaya
-agung sugiarto(12150269)*/
#include "stdio.h"
#include "conio.h"
#include "iostream"
using namespace std;
int main()
{
int i, n=10, max, min;
int data[10]={23,11,5,2,3,9,67,83,8,4};
cout<<"Diketahui data yang ada :";
for(i=0;i<10;i++)
{
cout<<data[i];
cout<<" ";
}
cout<<endl<<endl;
max=min=data[0];
for(i=0;i<n;)
{
if(data[i]>max)
{
max=data[i];
}
else if(data[i]<min)
{
min=data[i];
}
i++;
}
cout<<"Nilai maksimum dari data di atas adalah: "<<max<<endl<<endl;
cout<<"Nilai minimum dari data di atas adalah: "<<min;
getch();
}
-hadiansyah ade gunawan(12150617)
-miftakhul anam(12155442)
-afip fatkhurochim(12156207)
-aditya sanjaya
-agung sugiarto(12150269)*/
#include "stdio.h"
#include "conio.h"
#include "iostream"
using namespace std;
int main()
{
int i, n=10, max, min;
int data[10]={23,11,5,2,3,9,67,83,8,4};
cout<<"Diketahui data yang ada :";
for(i=0;i<10;i++)
{
cout<<data[i];
cout<<" ";
}
cout<<endl<<endl;
max=min=data[0];
for(i=0;i<n;)
{
if(data[i]>max)
{
max=data[i];
}
else if(data[i]<min)
{
min=data[i];
}
i++;
}
cout<<"Nilai maksimum dari data di atas adalah: "<<max<<endl<<endl;
cout<<"Nilai minimum dari data di atas adalah: "<<min;
getch();
}
Langganan:
Postingan (Atom)