aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C++
  • What is the output of the following C++ code? #include us...
Multiple choice

What is the output of the following C++ code?

#include <iostream> using namespace std; int main() { cout.setf(ios::hex,ios::basefield); cout<<100; return 0; }

  1. 100

  2. 144

  3. 64

  4. 40

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Here we have set basefield flag as hex which will display100 in hex and output is 64. Hence, the given option is correct.

Keep practicing — related questions

  • What is the output of the following C++ code? #include <iostream> using namespace std; int main () { int a;...
  • What is the output of the following program? #include <iostream> using namespace std; class Base { public: ...
  • What is the output of C++ program given below? #include<iostream> using namespace std; int main() { int y=8...
  • What is the output of C++ program given below? #include<iostream> using namespace std; int main() { typedef...
  • What will be the output for the following? #include<iostream.h> { int x[6]={62,45,7,10,82,90}; cout<<*x; }
  • What is the output of C++ program given below? #include<iostream> using namespace std; class Test { public:...
  • What is the output of the following program? #include <iostream> using namespace std; class Base { public: ...
  • What is the output of the following program? Assume sizeof(int) = 4 #include <iostream> using namespace std...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy