adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <algorithm>
    #include <vector>
    using namespace std;
    int main () 
    {
        int myints[] = { 10, 20, 30 ,40 };
        int * p;
        p = find (myints, myints + 4, 30);
        --p;
        cout << *p << '\n';
        return 0;
    }

a.

10

b.

20

c.

30

d.

40

Answer: (b).20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?