ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What will be the output of the following C++ code
#include <iostream>
#include <array>
using namespace std;
int main(int argc, char const *argv[])
{
array<int,arr arr1.fill(2);
for(int i=0;i<5;i++)
cout<<arr1[i];
cout<<endl;
return}
Correct Answer: C — 22222
empty() function is used to check whether the size of an array class is zero or not. It is not used to check whether an array is empty or not. The function true only if size/max_size of an array is zero otherwise it returns false.