Online Tests for Programming and protocol solving in C language

Programming and protocol solving in C language

Download Guruji24.com App on Google Play
  • 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the "OMR" answer sheet supplied with the question paper, following instructions therein.


    Q - 1.1 . Consider the following code segment main() {char s[100]; scanf("%s",s); printf("%3s",s);} if "India is great" is entered upon the execution of the program for s, then what will be the output of the above code segments?

    Q - 1.2 . Consider the following code segment: char s[]="abc"; char *p=s; Which of the following is not valid statement to access 'p' in string x?

    Q - 1.3 . Escape sequence

    Q - 1.4 . C' is a

    Q - 1.5 . Consider the following code snippet marks=80; switch(marks){case 60: grade='C'; break; case 70: grade='B'; break; case 80: grade='A'; break; default grade=E; } What is the value of 'grade' after the switch statement is executed?

    Q - 1.6 . Which one the following statement is incorrect?

    Q - 1.7 . How many times will the following loop be executed? Ch='b' while(ch>='a' && ch<='z')

    Q - 1.8 . When multidimensional arrays are assigned initial value

    Q - 1.9 . What is the output of the following program? Int arr[]={1,2,3,4} main() { int a,*ptr,b,c; a=51% 26; ptr=&a; a+=2; b=arr[1]+a; c=*ptr+b; printf("%d %d %d",a,b,c);}

    Q - 1.10 . What will be the output of the following code segment? Main() {char s[10]; strcpy(s,"abc"); printf("%d, %d", strlen(s), sizeof(s))}

    2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the "OMR" answer sheet supplied with the question paper, following instructions therein.


    Q - 2.1 . Consider the following C statement.. While ((c==getchar())!=EOF) where 'c' is of type int. There is a run time error in this statement.

    Q - 2.2 . A loop may contain another loop in its body.

    Q - 2.3 . In 'C' program, all variables must be declared before they are used.

    Q - 2.4 . Space is set up in memory on specifying a structure.

    Q - 2.5 . A single statement for loop is terminated with a semicolon.

    Q - 2.6 . Linked list nodes are constructed using self referential structure.

    Q - 2.7 . A do-while loop is useful when the body of the loop will be executed at least once.

    Q - 2.8 . Multiple increment expressions in a for loop expression are separated by commas.

    Q - 2.9 . The main() function by default returns the integer type value.

    Q - 2.10 . Every 'if' statement can be converted into an equivalent 'switch' statement.

    3. Match words and phrases in column X with the closest related meaning/ word(s)/phrase(s) in column Y. Enter your selection in the "OMR" answer sheet supplied with the question paper, following instructions therein

    Question Select Answer
    3.1 if(n>0) { if (d>e) z=a;} else z=b;
    3.2 Put a break after the last case of a switch statement
    3.3 *(*(a+1)+2);
    3.4 getchar()
    3.5 Retains value across function calls
    3.6 Easier to insert a node in unsorted linked list at
    3.7 The life of an auto variable declared in function ends
    3.8 Transpose
    3.9 The exit function
    3.10 Deleting the node whose address is known without traversing the list

    4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the "OMR" answer sheet supplied with the question paper, following instructions therein.

    Question Select Answer
    4.1 A pointer to void can hold pointer to _______.
    4.2 _______ function forces exit from a program.
    4.3 A multidimensional array A[10][9] can store _______ number of elements.
    4.4 The _________ loop executes at least once.
    4.5 _________ access of element in linked list is not possible.
    4.6 The logical operator == check for _______ two values.
    4.7 A stack may be represented by a _________ linked list.
    4.8 C provides a multiple branch selection statement known as _______.
    4.9 C provides a multiple branch selection statement known as _______.
    4.10 _______ statement forces exit from any loop.