Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TUGAS ALGORITMA DAN LOGIKA 2
#1
Nama : Hasna Fauziah
Kelas : 13.1A.21
Nim : 13180677

1. for
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<conio.h>

main()
{

int x;
cout<<"Masukan bilangan :";
cin>>x;

for(int i=1;i<=x;i=i+1){
cout<<"Tugas Logika dan Algoritma "<<i<<endl;


}
getch();

}

2. do while

#include<stdio.h>
#include<string.h>
#include<iostream.h>
#include<conio.h>

main()

{
int i=100;
do

{
cout<<"Tugas Logika dan Algoritma"<<endl;
1=i-10
}
while(i>0);

getch();
}

3. do 

#include<string.h>
#include<iostream.h>
#include<conio.h>

main()
{
int i=100;
do

{
cout<<"Tugas Logika dan Algoritma"<<i<<endl;
i=i-100
}
while(i>0);

getch();
}


Attached Files
.pdf   Tugas Logika dan Algoritma 2.pdf (Size: 206.46 KB / Downloads: 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)