Minggu, 13 September 2015

Pertemuan Minggu [01] Structur Data [08 September 2015]

Pada Pertemuan Pertama kali ini membahas perulangan.

1. Perulangan For
        #include <conio.h>
        #include <iostream.h>
        
        int main(){
                  for(int i=1;i<10;i++){
                   cout<<i;
          }
          getch();
        )

2. Perulangan While
       #include <conio.h>
       #include <iostream.h>

       int main(){
               int i;
             while (i<=10){
                 cout<<i;
            }
          getch();
         }

3. Perulangan Do-while
       #include <conio.h>
       #include <iostream.h>

       int main(){
               int i;
             do{
                 cout<<i;
                i++;
            }
          while(i<=10)
          }
          getch();
         }

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

       void main(){
         int hitung(int a, int b){
          total=0;
            for(int a=1;a<=b;a++){
                 total=total+1;
             return total;
           }       
          getch();
         }
5. Template (Fungsi)
           #include <conio.h>
           #include <iostream.h>
    
           void main(){
                      Template<Class T>
                        T hitung(T a, T b){
                           total=0;
                           for(T a=1;a<=b;a++)
                           total=total+1;
                           return total;
                        }
                       getch();
                   }

6. Fungsi Ganjil
          #include <conio.h>
          #include <iostream.h>

           void main(){
                       void ganjil(int a, int b){
                        for(a=1;a<=b;a++){
                            if(a%2!0){
                              cout<<a<<",";
                          }
                      getch();
                 }

Sekian dan Terima kasih.

1 komentar:

  1. JackpotCity Casino - Las Vegas, NV Hotels - MapYRO
    Discover the 남원 출장샵 best online 시흥 출장마사지 casinos at JackpotCity JackpotCity offers the ultimate 이천 출장마사지 in online 경상남도 출장안마 gambling, including slots, table 거제 출장샵 games, video poker,

    BalasHapus