Home / MCQ Bank / Computer
Computer Functions And Procedures In C Plus Plus Difficulty: Medium

What will be the output of the following C++ code? #include <iostream> #include <stdarg.h> using namespace std; float avg( int Count, ... ) { va_list Numbers; va_start(Numbers, Count); int Sum = 0; for (int i = 0; i < Count; ++i ) Sum += va_arg(Numbers, int); va_end(Numbers); return (Sum/Count); } int main() { float Average = avg(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); cout << "Average of first 10 whole numbers : " << Average; return 0; }

Select the correct option to test your answer:

More Computer Questions

What will be the ciphered text corresponding to plain text "SECRET" if atbash cipher is used for encryption? Which sorting algorithm is most efficient for sorting small arrays? What is virtual inheritance? What will be the output of the following C++ code? #include <vector> #include <algorithm> #include <iostream> using namespace std; int main() { vector<int> v; for(int i=0;i<10;i++) v.push_back(i+1); for(int i=0;i<10;i++) cout<<v[i]<<" "; cout<<endl; random_shuffle(v.begin(), v.end()); for(int i=0;i<10;i++) cout<<v[i]<<" "; return 0; } What is the type of inf?