Question

1. Every C++ program must have:     A. a cout statement    B. function main                C....

1. Every C++ program must have:

    A. a cout statement    B. function main             

  C. a #include          D. All of the above

          

     2. main() is a method that is part of the ‘Standard Library’.

         T__   F__   

     3. Inside a ‘Console Application’, a ‘Project’ may implement multiple

         ‘Solutions’.

                       

         T__   F__   

     4. The C++ source-code files are listed with the extension .sln.

    T__   F__    

      5. It is recommended to start the name of an identifier with a digit.

        T__   F__    

      

      6. The following declaration is legal in C++:

             int sample{23.5};  

                                   

         T__   F__

      7. The following functional-declaration-style is no longer legal in C++:

            int sample(23.5);  

                                 

         T__   F__

      8. The following statement is not accepted by the compiler:

         char c{500};       

                          

     T__   F__            

                      

9. But the following statement is accepted by the compiler:

          char c(500);       

T__   F__

     10. The following code-segment of ‘main()’ is syntactically correct:

  

             const int x;         

             x{5};

        

         T__   F__

    11. The following line of code is legal in C++:

             const int x = 65,535;      

         T__   F__         

12. The following declaration is accepted by the compiler:

        int return;        

    T__   F__

     13. /n is a new-line symbol.

         T__   F__  

14. int x;

    int y;          

    const int z{};  

    Which statement will cause a compile error?

                                                      

    A. x = y = z;   B. x = z = y;   C. x = y = 'A';   D. x = y = 10000;      

                   

15. int x{4};

    int y;

    y = x++ + 1;

    What is the value of variable y after the above statements execute?  

                                                 

    A. 4      B. 5     C. 6     D. 7     E. None of the above

16. int x{4};

    int y;

    y = --x + 1;

    What is the value of variable y after the above statements execute?

                                                   

    A. 4      B. 5     C. 6     D. 7     E. None of the above

17. int x{11};

    int y;

    y = x % 3;

    What is the value of variable y after the above statements execute?

                                            

    A. 3     B.2.2   C. 2    D. 3.33   E. None of the above

18. x != y is not the same as (x>y || x<y)  

    T__   F__

19. It is correct to write x%y if either x or y is float.

    T__   F__     

     20. The following code-segment of ‘main()’ is flagged with an error:

             int x{11};

             double y = (double)x / 2;           

         T__   F__  

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Every C++ program must have:     A. a cout statement    B. function main                C....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. Inside a ‘Console Application’, a ‘Project’ may implement multiple          ‘Solutions’.             T__   F__   ...

    3. Inside a ‘Console Application’, a ‘Project’ may implement multiple          ‘Solutions’.             T__   F__    6. The following declaration is legal in C++:              int sample{23.5};                  T__   F__ 7. The following functional-declaration-style is no longer legal in C++:             int sample(23.5);             T__   F__ 8. The following statement is not accepted by the compiler:          char c{500};            T__   F__                 9. But the following statement is accepted by the compiler:           char c(500);    ...

  • 41. Executing the "continue" statement from within a loop     causes control to go     A....

    41. Executing the "continue" statement from within a loop     causes control to go     A. to the next line of code     B. out of the loop     C. to the beginning of the loop          D. to check the loop condition for repeating the loop     E. none of the above      42. The 'default' statement inside a 'switch()' is optional.          T__   F__             43. The following 'switch' implementation is legal:              int i = 2;        ...

  • 31. The following code segment is syntactically correct:              int number{20};          cout << number <<...

    31. The following code segment is syntactically correct:              int number{20};          cout << number << setbase(16) << " " << number                               << setbase(10) << " " << number                                 << showpos << " " << number << endl;                 T__   F__       32. The following statement wants to determine if ‘count’ is outside the     range of 0 through 100:             if (count < 0 && count > 100)                                             T__   F__ 33. There is...

  • 81. The following function call doesn’t agree with its prototype:              cout << BoxVolume( 10, 5...

    81. The following function call doesn’t agree with its prototype:              cout << BoxVolume( 10, 5 );                    int BoxVolume(int length = {1}, int width = {1}, int height = {1});                                                     T__   F__                                                                     82. The following function is implemented to swap in memory the          argument-values passed to it:         void swap(int a, int b)                   {           int temp;             temp = a;             a = b;             b = temp;        ...

  • 61. The following program is accepted by the compiler:         int sum( int x, int y...

    61. The following program is accepted by the compiler:         int sum( int x, int y )         {             int result;             result = x + y;            }                            T__   F__ 62. The following implementation is accepted by the compiler:         void product()         {             int a; int b; int c; int result;             cout << "Enter three integers: ";             cin >> a >> b >> c;             result = a * b * c;            ...

  • 1-Is it possible to run a program without a main() function? Yes No 2- How many...

    1-Is it possible to run a program without a main() function? Yes No 2- How many main() functions can one have in a program? 2 This depends on what compiler you use. As many as you like 1 3- What does the following code fragment leave in x? char a = 'A'; int x = sizeof (a); 1 Depends on what compiler you use. 4 2 4- True or false: In a C program I can have two functions with...

  • 24. What will be the output of the following code #include<stdio.h> int main() { char *p;...

    24. What will be the output of the following code #include<stdio.h> int main() { char *p; p="%d\n"; p++; p++; printf(p-2, 100); return 0; } a. 100 b. 00 c. 10 d. compiler error e. none of the above 26. What will be the output of the following code #define TRIPPLE(x) (3*x) int x = 4; printf(“triple(%d) = %d \n”,x+1, TRIPPLE(x+1)); a. triple(5) = 12 b. triple(5) = 13 c. triple(4) = 14 d. triple(4) = 15 e. none of the...

  • 12. if x = 0x25 then which of the following statements is correct a) if y...

    12. if x = 0x25 then which of the following statements is correct a) if y = x | (1<<1) then y is 0x26 b) if y = x << 1 then y is 0x4A Review questions COMP 2401 Fall 2019 Page 4 of 14 c) if y = x & 0x37 then y is 0x35 d) if y = x | 0x37 then y is 0x35 e) All of the above statements are incorrect 13. What will be the...

  • should be in C language What is the output of the following segment of C code:...

    should be in C language What is the output of the following segment of C code: void CapsLetter (char* x, charl); int main() { char* text; text="This is some sample text."; CapsLetter(text, 'e'); printf("%s", text); return 0; سی void Caps Letter (char* x, char 1) { int i=0; while (x[i]!='\0') { if (x[i]==1) x[i]=1-32; } 1. This is som sample text. 2. THIS IS SOME SAMPLE TEXT. 3. This is some sample text. 4. this is some sample text. What...

  • 11. What is the output of the following program fragment? int v[5] = {10, 20, 30,...

    11. What is the output of the following program fragment? int v[5] = {10, 20, 30, 40, 50}; for (int i=3; i>0; i--) { cout << v[i] << " "; } A. 102030 B. 302010 C. 403020 D. 40302010 12. Given the following code: char a[20]; char b[30]; Copy(a, b); // Copy all elements of b into a What is the best signature (header) of the Copy function? A. void Copy(char x[], char y[]) B. void Copy(const char x[], char...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT