What will happen when you attempt to compile and run the following code?#include <iostream>#include <set>#include <vector>using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector<int>v(t, t+10);set<int> s1(v.begin(),v.end());s1.insert(v.begin(),v.end());bool found = s1.find(7);if (found){cout<<"Element found!\n";}else {cout<<"Element not found!\n";}return 0;}
A. program will display "Element found!"
B. program will display "Element not found!\n"
C. code will not compile
D. changing type of variable found to int will make this code compile
What will happen when you attempt to compile and run the following code?#include <iostream>#include <set>#include <vecto
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will happen when you attempt to compile and run the following code?#include <iostream>#include <set>#include <vecto
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!