P13 programming set of multiple choice questions

You are a fan of programming languages ​​and want to learn more about this topic. To give you an interesting reading about programming, in this article, the network administrator will send you a good quiz about this topic. Invite your reference.
  1. Question 1. To declare a function to check an array is increasing or not we use the following statement:
    1. void CheckAsc (int a [], int n);
    2. int CheckAsc (int * a, intn);
    3. long CheckAsc (int * S);
    4. double CheckAsc (int S [], intn);
  2. Question 2. Which code will permutate 2 numbers a and b:
    1. t = a; a = b; b = t;

    2. t = a; a = b; t = b;
    3. a = t; b = a; t = b;
    4. t = b; b = a; a = t;
  3. Question 3. In the following sentences, which sentence is correct:
    1. The value of a variable can be changed.

    2. The value of a variable cannot be changed
    3. It is possible to declare two variables with the same name in the same function.
    4. Cannot declare 2 variables with the same name in the same function.
  4. Question 4. Symbols that characterize the impact on data are called:
    1. Operator
    2. Expression.
    3. Jaw
    4. Turn
  5. Question 5. The size of the pointer variable is:
    1. 1 byte.
    2. 2 bytes

    3. 3 bytes.
    4. There is no right answer
  6. Question 6. Indicate the value of the expression: 2 + 4> 2 && 4 <2;
    1. first
    2. -first
    3. 0
    4. There is no right answer
  7. Question 7. What is the logical value of the following expression:! (1 && 1 || 1 && 0);
    1. first
    2. 0
    3. -first
    4. There is no right value
  8. Question 8. Select the expression representing num as the number between 1 and 9 but it must be 4:
    1. num> 1 && num
    2. num> 1 || num
    3. num> = 1 && num <= 9 && num! = 4;

    4. No sentence is correct
  9. Question 9. Find the results of the following program:
     { 

    int n;

    for (n = 18; n> 0; n / = 2)

    printf ('% 3d', n);

    };
    1. '18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 '.
    2. '18 9 4 2 1 '.
    3. '18 9 4 2 1 0 '.
    4. No answer right
  10. Question 10. Find the results of the following program:
     #include 

    main ()

    {

    int i, ch;

    for (i = 0, ch = 'A'; i <5; i ++, ch ++) putchar (ch);

    };
    1. 'ABCDE'.
    2. 'ABC'.
    3. 'ACEG'.
    4. No answer right
  11. Question 11. Find the results of the following program:
     #include 

    main ()

    {

    int i, ch;

    for (i = 0, ch = 'A'; i <4; i ++, ch + = 2) putchar (ch);

    };
    1. 'ABCDE'.
    2. 'ABC'.
      1. 'ACEG'.
    3. No answer right
  12. Question 12. Which of the following is correct if the declaration is made:
     char * ptr; 

    char msg [10]; char v;
    1. ptr = v;
    2. ptr = msg;
    3. Both sentences are true
    4. No sentence correctly
  13. Question 13. Why are the functions scanf () and printf () called 2 import and export functions in the format:
    1. Because they have a format string in the parameter.
    2. They are often used to import and export values ​​in a predetermined style.
    3. The above two functions are not two formatted export functions.
    4. Another reason
  14. Question 14. Which of the following functions belongs to unformatted import functions:
     printf (); 

    scanf (); getchar (); putchar ();
    1. 1 and 2
    2. 3 and 4
    3. 1 and 4
    4. 2 and 3
  15. Question 15. If strcmp (S1, S2) returns a negative integer, then:
    1. The content of S1 series is larger than the content of the S2 series
    2. Chain content S1 is smaller than the content of series S2.
    3. The content of chain S1 is equal to the content of chain S2.
    4. Data entered is not properly formatted

4 ★ | 1 Vote