Minggu, 17 April 2016

LATIHAN DIKTAT

LATIHAN 1 diktat bab7

#include <iostream>
#include <windows.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void masuk(int c[20],int b[20]){
    for (int i=1;i<=2;i++){
        for (int j=1;j<=3;j++){
            cout<<"Vaktor A "<<i<<","<<j<<" =";cin>>b[i,j];
            cout<<"Vaktor B "<<i<<","<<j<<" =";cin>>c[i,j];
         
        }
    }
    system("cls");
}
void proses(int b[20],int c[20],int hasil[20],int kali[20]){
 
        cout<<"Vaktor A"<<endl;
    for(int i=1;i<=2;i++){
        for(int j=1;j<=3;j++){
            cout<<b[i,j]<<" ";
        }
    }
    cout<<"\n\nVaktor B"<<endl;
        for(int i=1;i<=2;i++){
        for(int j=1;j<=3;j++){
            cout<<c[i,j]<<" ";
        }
    }
    cout<<"\n\nVektor C"<<endl;
    for (int i=1;i<=2;i++){
        for (int j=1;j<=3;j++){
            hasil[i,j]=b[i,j]+c[i,j];
         
            cout<<hasil[i,j]<<" ";
        }
     
    }
    cout<<"\n\nVaktor Hasil Kali"<<endl;
    for (int i=1;i<=2;i++){
        for (int j=1;j<=3;j++){
            kali[i,j]=b[i,j]*hasil[i,j];
         
            cout<<kali[i,j]<<" ";
        }
     
    }
    cout<<"\n\nBanyak Elemen ="<<12;
}

int main(int argc, char** argv) {
    int hasil[20];
    int kali[20];
    int b[20];
    int c[20];
    cout<<"Menghitung faktor"<<endl;
    masuk(b,c);
    proses(b,c,hasil,kali);
    return 0;
}

LATIHAN 3diktat bab 7
Mengubah huruf Kapital ke huruf kecil.
Void nama(){
I=integer.
Char nama[100];
Char c;
Char entri[100]//variabel entri maksimum 100 karakter.
While(nama[i]);
{
If(isupper(c)) c=tolower(c);
Puthcar (c);
Mengubah huruf kecil ke huruf kapital ;
while (entri[a]){
out=entri[a];
if(islower(out)) out=toupper(out);
putvhar (out);
END;

c++nya :

Related Articles

0 komentar:

Posting Komentar

Diberdayakan oleh Blogger.