Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TUGAS LOGIKA DAN ALGORITMA
#1
NAMA : WIDYA PUSPITA K

NIM : 13181069

KELAS : 13.1A.21





1. LOOPING WHILE

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

main()
{

 int i;
 i = 1;
 while (i <= 10)

{
  cout<<" Karanganyar "<<i<<endl;
  i++;
}

getch();
}


2. LOOPING DO WHILE

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


main()
{


int i;
i = 1;
do {
cout<<"Widya puspita "<<i<<endl;
i++;
}
while (i <= 10);

getch ();
}


3. LOOPING FOR

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

main()
{

 int i,x;
 cout<<"Masukkan batasnya :";
 cin>>x;
 for(i=1; i<=x; i++)
{
 cout<<i<<" ";
}

getch();
}


Attached Files
.docx   TUGAS INDIVIDU FLOWCHART.docx (Size: 60.2 KB / Downloads: 0)
Reply
#2
Nama : Ria Uma Arbela
Kelas : 13.1A
NIM : 13180099


1. WHILE 


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

main()
{

int x=1;
while (x<=9)
{
cout<<"silahkan tunggu ...."<<endl<<endl;
x++;
}
getch();
}



2. DO WHILE


#include <iostream.h>

int main()
{
float number, sum=0.0;

      do{
      cout<<"Enter a number : ";
         cin>>number;
         sum += number;
      }
      while(number != 0.0);
      cout<<"Total sum = "<<sum;

      return 0;
}


3. FOR


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


int main()
{
int a;
   for(a=1;a<=10;a++) {
    cout <<a<<endl;
      }
      getch();
}


Attached Files
.docx   TUGAS INDIVIDU FLOWCHART.docx (Size: 60.21 KB / Downloads: 1)
Reply
#3
NAMA :ILHAMSYAH FITRAH
NIM    :13180114
KELAS :13.1A.21


Attached Files
.docx   TUGAS PROGRAM DAN FLOWCHART.docx (Size: 60.89 KB / Downloads: 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)