Let's Have Some Fun ^_^

10 Questions | Total Attempts: 84

SettingsSettingsSettings
Please wait...
Let


Questions and Answers
  • 1. 
    What is the output of the following program? int x = 10 int main(){ int y = x; cout << y << endl
    • A. 

      1010

    • B. 

      10 10

  • 2. 
    Int main(){ int x = 10; int y = 5; [Blank]{ cout << "x is greater than y"; return 0; }
  • 3. 
    What is the output of the following program? int x = 10; int main(){ int x = 20; cout << x; return 0; }
    • A. 

      10

    • B. 

      Compile Error

    • C. 

      20

    • D. 

      Run time Error

  • 4. 
    Which of the following is not a correct variable type?
    • A. 

      Float

    • B. 

      Real

    • C. 

      Double

    • D. 

      String

  • 5. 
    Which of the following could be a comment? (check all the apply)
    • A. 

      /*comment/*

    • B. 

      // comment

    • C. 

      {comment}

    • D. 

      /*comment*/

  • 6. 
    Which of the following is the correct operator to compare two variables?
    • A. 

      :=

    • B. 

      =

    • C. 

      ==

    • D. 

      Equals

  • 7. 
    What is the output of the following program? int main(){ cout >> 10 << 11 <<endl;
    • A. 

      10 11 12

    • B. 

      1011 12

    • C. 

      101112

    • D. 

      Compile Error

  • 8. 
    What is the output of the following question if the input is 0? int main(){ int x; cin >> x; if(!x){ cout << "hello"; } else{ cout << "world"; } return 0; }
    • A. 

      Compile Error

    • B. 

      Run time Error

    • C. 

      Hello

    • D. 

      World

  • 9. 
    What is the output of the following program? int main(){ int x = 10; int y = x++; int z = ++y + (x/2); cout << x << endl; cout << y << endl; ​​​​​​​cout << z << endl; return 0; }
    • A. 

      10 11 17.5

    • B. 

      10 12 15

    • C. 

      11 12 17

    • D. 

      11 11 16  

  • 10. 
    What is the output of the following program? int main() {     bool x = -1;      x++;      if (x)      {          x = x % 3;          cout<<(x > ++x)<<endl;      }      else         cout<<x++<<endl; x = x++;        cout<<(x < x++)<<endl;                                return 0; }
    • A. 

      1 0

    • B. 

      1 1

    • C. 

      True false

    • D. 

      0 0

    • E. 

      False true

    • F. 

      False  false

    • G. 

      Compiler Error

Back to Top Back to top