You are on page 1of 7

LOGIKA DAN ALGORITMA

Nama :
1. Adesti Farah Medina - 12160550
2. Andrian Erlangga – 12165038
3. Ester Monica – 12161780
4. Erik Setiawan - 12161527
5. Iksan Pratama - 12160420
6. Rachmat Darmawan - 12160418

Kelas : 12.1F.07
Jurusan : MANAJEMEN INFORMATIKA
Kampus : BSI SALEMBA 22
Dosen : Adhitya Ahmad Pradypta (AAP)
TUGAS : QUIZ 1 NOVEMBER 2016
#include<iostream.h>
#include<conio.h>

main(){

int i,j,k,l,m;

for(k=1;k<=5;k++){

cout<<k;

cout<<endl;

for(i=1;i<=5;i++){

if(i==1){
cout<<"2";

}else if(i==5){

cout<<"4";

}else{

cout<<" " ;

}
cout<<endl;

for(j=1;j<=5;j++){
if(j==1 || j==5){

cout<<"3";

}else{
cout<<" " ;

}
}

cout<<endl;
for(m=1;m<=5;m++){
if(m==1){
cout<<"4";

}else if(m==5){

cout<<"2";

}else{
cout<<" " ;

cout<<endl;
for(l=5;l>=1;l--){

cout<<l;

getch();

}
Hasil Borland C++ (Soal No. 1)

Script Borland C++ (Soal No. 1)


Script Borland C++ (Soal No. 1.1)

Script Borland C++ (Soal No. 1.1.1)


#include <conio.h>
#include <iostream.h>
main()

int a,b,n=5,c;

for(a=n;a>=1;a--)

c=n-a;

while(c!=0)

{
cout<<" ";

c--;

}
for(b=a;b>=1;b--)

cout<<b;

cout<<endl;

getch();
}
Hasil Borland C++ (Soal No. 2)

Script Borland C++ (Soal No. 2)

You might also like