Kamis, 12 April 2012

Nesteed if bahasa C


 1. Membuat Program tampilkan data Mahasiswa terendah dan Jumlah Mahasiswa
#include
#include
void main()
{ int t,a,M,J;
 scanf("%i",&t);
 M = t;
 J = 1;
 for(a=2; a<=50; a++)
   { scanf("%i",&t);
     if(t < M)
       { M = t;
         J = 1;
        }
     else
       if(t == M)
          J++;
     }
   printf("\nTerendah : %i", M);
   printf("\nJumlah Mahasiswa : %i", J);
   getch();
 }

2. Membuat program, Input data 3 sisi segitiga lalu atur jika 2sisi sama maka Sama sisi, jika kakinya sama maka sama kaki, jika tidak keduaya maka Sembarang.
#include
#include
void main()
{  int t,a,m;
   printf("Masukan Nilai 1 :");
   scanf("%i", &t);
   printf("Masukan Nilai 2 :");
   scanf("%i", &a);
   printf("Masukan Nilai 3 :");
   scanf("%i", &m);
   if(t==a)
       { if(t==a)
              printf("SAMA SISI");
        else
                printf("SAMA KAKI");
      }
   else
       { if(t==m)
              printf("SAMA KAKI");
        else
                { if(a==m)
                    printf("SAMA KAKI");
              else
                      printf("SEMBARANG");
            }
      }
   getch();
}


3.Membandingka sudut segitiga
 #include
#include
    void main ()
    {
        int t,a,m;
            printf("angka1 : "); scanf("%d",&t);printf("\n");
            printf("angka2 : "); scanf("%d",&a); printf("\n");
            printf("angka3 : "); scanf("%d",&m); printf("\n");

            if((t+a==m)||(t+m==a)||(a+m==t))

            {
            printf("\n");
            printf("Segitiga");
            }
            else
            {
            printf("\n");
            printf("Bukan Segitiga");
            }

            if((t+a==m)||(t+m==a)||(a+m==t))
            {
            printf("\n");
            printf("Segitiga Siku-siku");
            }

            else
            {
            printf("\n");
            printf("Bukan Segitiga Siku siku");
            }
            getch();
}
Read More

Metode Kriptografi Dengan Kunci Simetris/Private


    Algoritma Running Key Cipher (vigenere cipher)
 
  •      Karakter ciphertext ditentukan pada pertemuan antara baris dan kolom
  •      Baris untuk karakter yang akan dienkrip, kolom untuk karakter dari kuncinya  
  •    Contoh :
    Plaintext      : Saya cinta budi luhur
    Key              : DEADF
    Ciphertext
    Caranya        : “Saya cinta budi luhur “ == plaintext     
                         : “dead fdead  fdea dfdea” == kunci
                                            : “VEYD HLRTD GXHI OZKYR”  == Ciphertext
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
F
G
Read More

Rabu, 11 April 2012

Tutorial pada Terminal Ubuntu


      Membuat folder bintang
ð  mkdir(spasi)bintang

     Membuat file bulan.txt
ð  nano(spasi)bulan.txt
ð  Kemudian tulis isinya
ð  Jika sudah selesai klik ctrl+x
ð  Klik Y dan enter

     Memindahkan file bulan.txt ke folder bintang
ð  mv(spasi)bulan.txt(spasi)bintang

     Mengubah hak akses file bulan.txt agar:
a. Owner: baca tulis eksekusi =tiga digit pertama nilainya 7
b. Group : baca tulis=tiga digit kedua nilainya 6
c. Other  : baca eksekusi=tiga digit akhir nilainya 5
ð  Pertama kita kembali ke folder bintang untuk ubah hak akses bulan
ð  1rwxrw-r-x
ð  chmod(spasi)765(spasi)bulan.txt
ð  111110101 artinya 111:7 ;110:6 ;101:5
ð  Melihat hasil hak akses : ls(spasi)-l

     Meng-Kompres folder bintang ke dalam file bintang.tar
ð  tar(spasi)-cf(spasi)bintang.tar(spasi)bintang
ð  melihat ukuran folder sebelum dikompres :  du(spasi)-h(spasi)bintang
ð  melihat ukuran folder sesudah dikompres :  du(spasi)-h(spasi)bintang.tar

      Menghapus folder bintang
ð  rm(spasi)-rf(spasi)bintang
ð  melihat hasil penghapusan : ls(spasi)-l

      Meng-Extract bintang.tar
ð  tar(spasi)-xf(spasi)bintang.tar

      Log in sebagai root
ð  Sudo(spasi)su

     Mengubah kepemilikan folder bintang dan isinya menjadi punya root
(petunjuk: gunakan perintah chown)
ð  chown(spasi)root(spasi)bintang
ð  untuk melihat hasilnya: ls(spasi)-l
Read More

Total Tayangan Halaman

Diberdayakan oleh Blogger.

Follow me

© tami'sBLOG, AllRightsReserved.

Designed by ScreenWritersArena