DSA 100 DAYS OF LEARNING

                                                                               DSA

LANGUAGE OPTED - C++

DAY-3 PASS BY REFERNCE AND VALUE



CLICK HERE for the pdf

1.SIZE OF VECTOR

#include <iostream>
#include <vector>
using namespace std;

int main() {

    vector<int> vec = {1, 2, 3, 4, 5,9};

    int size = vec.size();

   cout << "The size of the vector is: " << size << endl;
    return 0;
}
#include <iostream>

int main() {

    int arr[] = {1, 2, 3, 4, 5};

     size = sizeof(arr) / sizeof(arr[0]);

    cout << "The size of the array is: " << size << endl;
    return 0;
}



Comments