Quick actions

cmd+k|ctrl+k

Navigation

Languages

20-09-23_ProgArrayDinamis

Snippet info

Language

Cpp

Visibility

public

Author

artikacahaya

Created

2023-09-20T04:27:40.957856Z

Updated

2023-09-20T04:27:40.957856Z

   /* Demonstrasi larik satu dimensi dengan vektor */
   
   #include <stdio.h>
   #include <vector>
   using namespace std;
   
   void cetakLarik(int ukuran, vector<int> larik){
       int  i;
       for(i = 0; i < ukuran; i++)
           printf("%d\n", larik[i]);
   }
   
   int main(){
       vector<int> bilangan;
       int i; 
       for(i = 0; i < 10; i++)
          bilangan.push_back(i);
       cetakLarik(10, bilangan);
   }
INFO