It102 Programming Fundamentals: Quiz!

34 Questions | Total Attempts: 79

SettingsSettingsSettings
It102 Programming Fundamentals: Quiz! - Quiz

.


Questions and Answers
  • 1. 
    Which of the following is a sign used for comments?
    • A. 

      /

    • B. 

      *

    • C. 

      //

  • 2. 
    This line corresponds to the beginning of the definition of the main function of the program.
    • A. 

      Int main()

    • B. 

      Using namespace std;

    • C. 

      #inlcude

  • 3. 
    ______ is used to mark the end of the statement.
    • A. 

      Colon

    • B. 

      Semicolon

    • C. 

      Period

  • 4. 
    A portion of memory to store a determined valued is referred to as _________.
    • A. 

      Identifier

    • B. 

      Variable

    • C. 

      String

  • 5. 
    Which of the following is not a valid identifier?
    • A. 

      !x

    • B. 

      X

    • C. 

      X_y

  • 6. 
    Which of the following is a valid identifier?
    • A. 

      Cout

    • B. 

      Int

    • C. 

      _pi

  • 7. 
    When programming, the variables used are stored in the memory.
    • A. 

      True

    • B. 

      False

  • 8. 
    When variables are used, it is important to know what kind of data we want to store them.  This is referred to as ______.
    • A. 

      Data Types

    • B. 

      Data Expression

    • C. 

      Assignment Statement

  • 9. 
    Which of the following is the correct way on declaring variables?
    • A. 

      Int a

    • B. 

      Int a;

    • C. 

      Int a:

  • 10. 
    What type of data is used when using whole numbers?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Char

  • 11. 
    Analyze the following example: x = 4530.908; What type of data that the identifier x holds?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Char

  • 12. 
    What is the data type when variables hold values of a series of characters?
    • A. 

      Char

    • B. 

      String

    • C. 

      Float

  • 13. 
    Which of the following is an example of a variable assignment?
    • A. 

      X = 5;

    • B. 

      #define x 5

    • C. 

      Const int x;

  • 14. 
    Which of the following slash codes creates a new line?
    • A. 

      \t

    • B. 

      \n

    • C. 

      \\

  • 15. 
    The symbol { means?
    • A. 

      Begin

    • B. 

      End

    • C. 

      Stop

  • 16. 
    The ____ operator is used to compare data.
    • A. 

      ==

    • B. 

      =

    • C. 

      >

  • 17. 
    What is the purpose of debugging a program?
    • A. 

      To check the program for errors.

    • B. 

      To run the program

    • C. 

      To save the program.

  • 18. 
    Analyze the following program: #include <stdio.h> int main() { char x;   x = 1; } Is 1 declared properly in variable x?
    • A. 

      True

    • B. 

      False

  • 19. 
    Why is it important to include the file conio.h?
    • A. 

      Because getch() function relies on this file

    • B. 

      It adds a function to the main program

    • C. 

      Because the header is required to start the program

  • 20. 
     x=1; y=0;if (x==1 && y>x)    cout<
    • A. 

      10

    • B. 

      0 1

    • C. 

      1 0

    • D. 

      01

  • 21. 
    What are the things to avoid in creating variable identifiers?
    • A. 

      Using reserve words

    • B. 

      Starting with a number

    • C. 

      Using spaces

    • D. 

      Combining capital and small letters in one word

  • 22. 
    Analyze the following example:#include <iostream>using namespace std;int main(){   int x;     x = 'y';     cout<<'y';} What is the correct data type of x? 
    • A. 

      Char

    • B. 

      Float

    • C. 

      String

  • 23. 
    Analyze the following situation: #include <iostream> using namespace std; int main() {   char a;     a='1';     cout<<'a'; } Does the program run?
    • A. 

      Yes

    • B. 

      No

  • 24. 
    Analyze the following situation: #include <iostream> using namespace std; int main() {   float a,b,     char sum,c;     a = 1.5;     b = 2.5;     c = '3';     sum = c;     cout<<sum; } Will the program run correctly?
    • A. 

      Yes. The program will run correctly.

    • B. 

      No. The program is will not run because of errors.

  • 25. 
    You can check more than one choice on the following question. Which of the following is the correct way in initializing variables?
    • A. 

      Int a = 0

    • B. 

      Int a = 0'

    • C. 

      Float x (0);

    • D. 

      Int x =0;

    • E. 

      Char y = 'a';

Back to Top Back to top