GoConqr has a new look! Let us know what you think.

Quiz

C Quiz - Linkedin

Bianca Alexandra 32 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (32)

  1. 1Which Code sample will eventually cause the computer to run out of memory ?
    1. Ac while(1) { char *smallString = (char *) malloc(10); } ```
    2. Bc long long number = 1; while(1) number *= 2; ```
    3. Cc while(1) { char hugeString[1000000L]; memset(hugeString, 0, 1000000L); } ```
    4. Dc while(1) { long *bigArray = (long *) malloc(sizeof(long) * 1000); memset(bigArray, 1000000, 1000); free(bigArray); } ```
  2. 2What will this code print on the screen?
    int f1 (int a, int b)
    {
    if (a > b)
    {
    printf("A is greater than B\n");
    return 1;
    }
    else
    {
    printf("B is greater than A");
    return 0;
    }
    }

    main()
    {
    if (f1(20,10) || f1(10,20))
    printf("C is fun!\n");
    }
    1. AA is greater then B C is fun!
    2. BA is greater then B B is greater then A C is fun!
    3. CA is greater then B B is greater then A
    4. DNorthing is printed on Screen
  3. 3What is the name for calling a function inside the same function?
    1. Arecursion
    2. Bsubfunction
    3. Cinner call
    4. Dinfinite loop
  4. 4What does the declaration of variable c2 demonstrate?
    main(){
    char c1 ='a';
    char c2 = c1+10;
    }
    1. Acharacter arithmetic
    2. Bundefined assignment
    3. Ctype conversion
    4. Dinvalid declaration
  5. 5 A pointer to void named vptr, has been set to point to a floating point variable named g. What is the valid way to dereference vptr to assign its pointed value to a float variable named f later in this program?
    float g;
    void *vptr=&g;
    1. Af = _(float _)vptr;
    2. Bf = (float *)vptr;
    3. Cf = *(float *)vptr;
    4. Df = *(float)vptr;
  6. 6What is this declaration an example of?
    struct s {
    int i;
    struct s *s1;
    struct s *s2;
    };
    1. Aa node
    2. Ba linked list
    3. Ca stack
    4. Da binary tree
  7. 7A C header file is a file with extension .h that contains function declarations and macro definitons to be shared between several source files. Header files are listed using the preprocessing directive #include, and can have one of the following formats: #include <fileA> or #include "fileB". What is the difference between these two formats?
    1. AThe preprocessor will try to locate the fileA in same directory as the source file, and the fileB in a predetermined directory path.
    2. BThe preprocessor will try to locate the fileA in the fixed system directory. It will try to locate fileB in the directory path designated by the -l option added to the command line while compiling the source code.
    3. CThe file using fileA syntax must be system files, of unlimited number. fileB must be a user file at a maximun of one per source file.
    4. DThe preprocessor will try to locate the fileA in a predetermined directory path. It will try to locate fileB in the same directory as the source file along with a custom directory path.
  8. 8Using a for loop, how could you write a C code to count down from 10 to 1 and display each number on its own line?
    1. Ac for (int i = 0; i>=0, i--){ printf("%d\n", i); }//end of loop ```
    2. Bc int i; for (i=1; i<=10; i++){ printf("%d", i); } ```
    3. Cc int i = 10; while (i>0){ printf("%d\n", i); i--; } ```
    4. Dc int i; for (i= 10; i>0; i--){ printf("%d\n", i); }// end of loop ```
  9. 9What is not one of the reserved words in standard C?
    1. Avolatile
    2. Btypeof
    3. Cregister
    4. Dtypedef
  10. 10What does the program shown below return?
    int main(){
    int a=1, b=2, c=3, d=4;
    int x = a;
    if (a>b)
    if (b<c) x=b;
    else x=c;
    return(x);
    }
    1. A1
    2. B3
    3. C2
    4. D0

Information

Description
https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes/blob/master/c-(programming-language)/c-quiz.md
Language
English
Views
14
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?