Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TUGAS FLOWCHART & LOOPING
#1
Photo 
nama : Rizki Setya Pambudi
kelas : 13.1A
nim : 13180373

1.Tugas While Loop

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

using namespace std;

int main(){
int i,n;
i=1;

cout<<"Masukan N : ";cin>>n;
while (i<=n){
cout<<i<<". Tugas While Loop"<<endl;
++i;
}
getch();
}


2.Tugas Do While

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

using namespace std;

int main(){
int i,n;
i=1;

cout<<"Masukan N : ";cin>>n;
do {
cout<<i<<". Tugas Do While Loop"<<endl;
++i;
}
while (i<=n);
getch();
}

3. Tugas For loop

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

using namespace std;

int main(){
int i,n;

cout<<"Masukan N : ";cin>>n;
for(i=1;i<=n;i++){
cout<<i<<". Tugas For Loop"<<endl;
}
getch();
}


Attached Files Thumbnail(s)
       
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)