PROGRAM HOPPITY

#include<windows.h>
#include<iostream>
#include<stdlib.h>
#include<time.h>
#include<conio.h>
using namespace std;
using std::cout;
using std::cin;
int main(){
int a,b;
a=1;

cout<<“Masukan Angka : ” ;cin>>b;
system(“pause”);
do {
if((a % 3 == 0)&&(a % 5 == 0))
cout<<“Hop\n”;
else if (a % 3 == 0)
cout<<“Hoppity\n”;
else if (a % 5 == 0)
cout<<“Hophop\n”;

a++;
}while(a<=b);
getch();
return 0;
}

Ditulis dalam DEV C++. Leave a Comment »

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: