twitter


1. Identifikasi
       Input     : i
2. Algoritmanya
      Deskripsinya     :
                               i=1
                                           (i<=100)
                                           ((i%3==0)&&(i%5==0))



#include <cstdlib>
#include <iostream>



using namespace std;
class bil{
      public:
             bil();
             void cetak();
      private:
              int i;
              };
bil::bil(){
           }
      void bil::cetak(){
                i=1;
                while(i<=100)
                {
                             if((i%3==0)&&(i%5==0)){
                                                  cout<<"Bilangan habis di bagi 3 dan 5 : "<<i<<endl;
                                                  }
                                                  else{}
                                                  i++;
                                                  }
                             }
int main(int argc, char *argv[])

    bil x;
    x.cetak();
   
    system("PAUSE");
    return EXIT_SUCCESS;
}


Hasilnya : 







0 komentar:

Posting Komentar