What will be the output of the following C++ code? [code] #include <iostream> #include <Valarray> using namespace std; int main() { Valarray<in

What will be the output of the following C++ code?
Code:
#include <iostream>
#include <Valarray>
using namespace std;
int main()
{
	Valarray<int> varr = { 1, 2, 3, 4, 5 };
	for (int &x: varr) cout << x << " ";
	cout<<endl;
	varr = varr.cshift(-3);
	for (int &#038;x: varr) cout << x << " ";
	return 0;
}
A.
1 2 3 4 5
0 0 0 1 2
B.
1 2 3 4 5
3 4 5 0 0
C.
1 2 3 4 5
3 4 5 1 2
D.
1 2 3 4 5
0 0 0 0 0
 

Tìm kiếm

Back
Top