What is the output of the following code Int maln const int
What is the output of the following code? Int maln() { const int numCtry=5: vector ctryNames(numCtry); vector ctryMins(numCtry); int i = 0; ciryNames.at(i) = \"Australia\"; ctryMins.at(i) = 188; ++ ctryNames.at(i) = \"Brazil\"; ctryMins.at(i) = 222; ++i: ctryNames.at(i) = \"Canada\"; ctryMins.at(i) = 200; ++; ctryNames.at(i) = \"China\"; ctryMins.at(i) = 158; ++i; ctryNames.at(i) = \"France\"; ctryMins.at(i) = 212; ++i; for(i = 0; i 200){ //line 14 cout
Solution
Answer :Brazil Canada France
=====================================
Const int numCity means numCity is constant variable and its value cannot be changed.Here we created 2 vectors cityNames for storing names of cities and another is cityMins to store for storing distance for city.There are 3 cities with greater distance than 200 i.e. Brazil Canada France
The loop will check if distance is greater than 200,it is greater then it prints city name.
