Set of multiple choice questions about programming with P6

  1. Question 1. What is the screen printing result of the following program:
     #include 

    void main ()

    {

    int i;

    for (i = 2;; ++) printf ('% 3d', i);

    };
    1. Infinite loop
    2. ' 2'
    3. ' twelfth'
    4. Other results
  2. Sentence 2. Which of the following commands allows to be moved to a labeled place.
    1. break.
    2. goto.
    3. tiếp tục.
    4. exit.
  3. Question 3. Which of the following commands allows to stop the control statement:
    1. break.
    2. goto.
    3. tiếp tục.
    4. All 3 answers above
  4. Question 4. In C language, declare 'int array [3] [5]' which means:
    1. The elements of the array are integers
    2. A two-dimensional array of up to 15 elements and each element is an integer
    3. array [3] [5] is an element of the array
    4. All is wrong
  5. Question 5. Find errors in the following program:
     #include 

    void main ()

    {

    int sum;

    sum = 453 + 343

    printf ('Ket la:' sum);

    };
    1. Missing semicolon (;)
    2. Missing comma (,)
    3. Missing specification character
    4. All 3 factors above
  6. Question 6. What are the results of the following program:
     #include 

    void main ()

    {

    int i, j;

    for (i = 1; i <4; i ++) j = i; printf ('% 3d', j);

    };
    1. "1 2 3 4".
    2. '4'.
    3. '3'.
    4. Other results
  7. Question 7. Priority for logical operators is:
    1. AND, NOT, OR.
    2. NOT, OR, AND.
    3. OR, NOT, AND.
    4. NOT, AND, OR.
  8. Question 8. What are the results of the following program:
     #include 

    void main ()

    {

    int a = 40, b = 4;

    while (a! = b)

    if (a> b) a = ab; else b = three; printf ('% d', a);

    };
    1. 2
    2. 4
    3. 16
    4. Other results
  9. Question 9. Suppose in the C language using the declaration of 'double a [12]', element a [7] is the second element in array a:
    1. Friday
    2. Saturday
    3. 8th
    4. 9th
  10. Question 10. What are the results of the following program:
     #include 

    void hoanvi (int * px, int * py)

    {

    int z; z = * px;

    * px = * py;

    * py = z;

    };

    void main ()

    {

    int a = 15, b = 21; Festival (a, b); printf ('% d% d', a, b);

    };
    1. '15 21 '
    2. '21 15 '
    3. Error message when executing the program
    4. Other results
  11. Question 11. What is the following program result:
     #include 

    void hoanvi (int px, int py)

    {

    int pz;

    pz = px; px = py; py = pz;

    };

    void main ()

    {

    int a = 15, b = 21; Festival (a, b);

    printf ('% d% d', a, b);

    };
    1. '21 15 '
    2. '15 21 '
    3. Error message when executing the program
    4. Other results
  12. Question 12. Which of the following statements is not a benefit of using a function:
    1. Avoid redundancy, repeat a command repeatedly
    2. Easy to maintain
    3. Ability to reuse the command
    4. All the above are wrong
  13. Question 13. Declare variables: int m, n; float x, y; Which command is wrong:
    1. n = 5
    2. x = 10
    3. y = 12.5
    4. m = 2.5
  14. Question 14. Print results to the screen of the following program:
     #include 

    void main ()

    {

    char * s;

    s = 'waving boards'; strcpy (& s [5], & s [9]); printf ('% s', s);

    };
    1. 'hello'.
    2. 'hello'.
    3. 'ban ban'.
    4. 'Welcome board'.
  15. Question 15. Print results to the screen of the following program:
     #include 

    void main ()

    {

    int a = 100, b = 6; double f;

    f = (double) a / (double) b; printf ('% 2.2f', f);

    };
    1. '16'.

    2. '16 .00 '.

    3.   '16 .67 '.

    4. Other results
4.5 ★ | 2 Vote

May be interested

  • Multiple choice questions about network safety deployment have the answer P1Photo of Multiple choice questions about network safety deployment have the answer P1
    below network administrator will send you multiple choice questions around the topic of network security. network security is a broad topic, full of knowledge, so the following questions will help you add many useful things.
  • Test about computer architecture P6Photo of Test about computer architecture P6
    computer architecture is to design the basic concept and operational structure of a computer system. please join the network administrator to learn about this topic through multiple choice questions below.
  • Test on C programming P4Photo of Test on C programming P4
    the c language is the most widely used computer language, along with the java language, the leading popular programming languages, widely used in modern developers. below, invite readers to test their knowledge on this topic through the multiple-choice questions below.
  • Test of programming C P5Photo of Test of programming C P5
    if you are a fan of c programming language and intend to learn more about them, the following test of network administrator will be very suitable for you. let's learn and play with these interesting questions.
  • What do you know about C # P3 programming language?Photo of What do you know about C # P3 programming language?
    c # is an object-oriented programming language developed by microsoft, the start of their .net plan. please invite the network administrator to learn about this topic through the quiz below.
  • What do you know about C # P2 programming language?Photo of What do you know about C # P2 programming language?
    please read the knowledge with multiple choice questions around our c # programming topic below. the question set will have 10 sentences, 4 answers each and you should choose the correct answer.