Answers for "how do you create an array from 1 to n in c++"

C++
1

c++ initialize array 1 to n

std::vector<int> arr(SIZE);
for (int i = 0; i < SIZE; i++)
{
    arr[i] = i;
}
Posted by: Guest on March-30-2021

Code answers related to "how do you create an array from 1 to n in c++"

Browse Popular Code Answers by Language