CSE101 Ete Exam Answer Key

CoderIndeed
0
  1. Which of the following extension is valid for a file containing assembly code?

    1. .i
    2. .exe
    3. .s
    4. .obj
    Show Answer
    Answer :    Option ( D )
  2. Which of the following characteristics is not desired in a good algorithm?

    1. Abstraction
    2. Simplicity
    3. Correctness
    4. Ambiguity
    Show Answer
    Answer :    Option ( D )
  3. Role of pre-processor is to

    1. Detect semantic error
    2. Generate source code
    3. Combine various object files and library files
    4. Include the code of header files at the point, where they are included to general expanded source code
    Show Answer
    Answer :    Option ( D )
  4. Which of the following cannot be a variable name?

    1. Export
    2. Volatile
    3. Friend
    4. Number 1
    Show Answer
    Answer :    Option ( D )
  5. The continue statement cannot be used with

    1. Switch
    2. For
    3. While
    4. do while
    Show Answer
    Answer :    Option ( A )
  6. To stop the execution of a loop, we can use

    1. exit
    2. delete
    3. break
    4. None of above
    Show Answer
    Answer :    Option ( C )
  7. Which loop is guaranteed to execute at least once.

    1. while.
    2. do while
    3. for
    4. None of above
    Show Answer
    Answer :    Option ( B )
  8. Which of the following is unary operator?

    1. *
    2. Sizeof
    3. II
    4. &&
    Show Answer
    Answer :    Option ( B )
  9. Which will be the correct datatype of a variable used for storing the circumference of a circle?

    1. long int
    2. short int
    3. float
    4. Int
    Show Answer
    Answer :    Option ( C )
  10. What are the types of Functions in C Language?

    1. User Defined Functions
    2. Library Functions
    3. Both User Defined and Library Functions
    4. Basic and Advance Functions
    Show Answer
    Answer :    Option ( C )
  11. A function which calls itself is called as

    1. Auto Function
    2. Self Function.
    3. Recursive Function
    4. None of above
    Show Answer
    Answer :    Option ( C )
  12. Choose correct statement about Functions in C Language.

    1. Every Function may or may not return a value
    2. A Function is a group of C statements which can be reused any number of times.
    3. Every Function has a return type
    4. All of above
    Show Answer
    Answer :    Option ( D )
  13. Choose the correct statement about Functions of C Language.

    1. Default return type of any function is an Integer
    2. A function name cannot be same as a predefined C Keyword
    3. A function name can start with an Underscore ( ) or A to Z or a to z.
    4. All of above
    Show Answer
    Answer :    Option ( D )
  14. How many values can a C Function return at a time?

    1. Maximum of two values
    2. Only One Value
    3. Maximum of five values
    4. Any number of values
    Show Answer
    Answer :    Option ( B )
  15. What will be the output of the following code?
    #incIude<stdio.h>
    Int main()
    int a[3][2]= ((3,1),(6,5),(2,7);
    Printf( %d”, a[1][1]*a(2][1]);

    1. 10
    2. 35
    3. 12
    4. 42
    Show Answer
    Answer :    Option ( B )
  16. Consider the array elements 8, 22, 7, 9, 31, 5, 13. Using bubble sort, how many swapping will be done to sort these numbers in ascending order?

    1. 10
    2. 12
    3. 13
    4. 11
    Show Answer
    Answer :    Option ( A )
  17. What will be the output of the following code?
    #incIude&amp;lt;stdio.h&amp;gt;
    int main()
    int a[2][3]=(5, 4, 3, 2, 1);
    int i = 0, j = 0;
    for (i &mdash; 0; j < 2; i++)
    for (i = 0; j < 3; j++) printf("%d", a[i][j]); return 0;

    1. 5 4 3 2 1 garbage-value
    2. 5 4 3
    3. 5 4 3 2 1 0
    4. Compile time error
    Show Answer
    Answer :    Option ( B )
  18. The way to pass arrays to functions is

    1. Pass entire array once
    2. Pass array element by element
    3. Both with first and second option
    4. None of above
    Show Answer
    Answer :    Option ( A )
  19. To delete an element from a particular position of a 1D array, the considered index will be

    1. position-1
    2. position+1
    3. Exact at position
    4. None of above
    Show Answer
    Answer :    Option ( A )
  20. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    int a[10], i;
    for(i = 0; i < 10; i++)
    printf("%d", a[5]);

    1. 6
    2. 4
    3. S
    4. Garbage value
    Show Answer
    Answer :    Option ( C )
  21. An entire array can be passed to a function by using

    1. Call by reference
    2. Call by value
    3. Call by structure
    4. Call by array
    Show Answer
    Answer :    Option ( A )
  22. Consider an array (45, 77, 89, 90, 94, 99, 100). To search 99 using binary search, what will be the mid values in the first and second iteration?

    1. 90 and 94
    2. 90 and 99
    3. 89 and 94
    4. 89 and 99
    Show Answer
    Answer :    Option ( B )
  23. Consider 1D array as (5, 7, 20, 11, 9, 14). What value will be fetched for a[4]?

    1. 9
    2. 11
    3. 14
    4. 20
    Show Answer
    Answer :    Option ( A )
  24. For the array initialization as, int a[7] = (}; what value will be fetched for a[0]?

    1. Garbage Value
    2. O
    3. -1
    4. 1
    Show Answer
    Answer :    Option ( B )
  25. A pointer that cannot be directly dereferenced and need to be correctly type-casted is called as

    1. Constant pointer
    2. Void pointer
    3. Dangling pointer
    4. None of above
    Show Answer
    Answer :    Option ( B )
  26. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    int x=35,*p; p=&x;
    printf("\n%d",*p);

    1. Address of x
    2. 35
    3. Address of p
    4. Garbage value
    Show Answer
    Answer :    Option ( B )
  27. Malloc and Calloc functions are used for

    1. Static memory allocation
    2. Dynamic memory allocation
    3. Both static and dynamic memory allocation
    4. None of above
    Show Answer
    Answer :    Option ( B )
  28. Which one of the followings is a valid pointer declaration?

    1. datatype ptrname;
    2. datatype ptrname*;
    3. datatype *ptrname;
    4. datatype *(ptrname*);
    Show Answer
    Answer :    Option ( C )
  29. Type of pointer which points to a memory location which is already deleted or deallocated is

    1. Wild pointer
    2. Dangling pointer
    3. Void pointer
    4. None of above
    Show Answer
    Answer :    Option ( B )
  30. A pointer which is not Initialized during its definition and holds some garbage value is called as

    1. Wild pointer
    2. Null pointer
    3. Dangling pointer
    4. Void pointer
    Show Answer
    Answer :    Option ( A )
  31. What will be the output of the following code?
    #incIude <stdio.h> int main()
    int *ptr, num = 15; ptr = &num;
    *ptr += 1;
    printf( /d, %d", *ptr, num);

    1. 15, 16
    2. 16, 15
    3. 16, 16
    4. 15, 15
    Show Answer
    Answer :    Option ( C )
  32. The correct syntax of typecasting in void pointers is

    1. *(data type*) pointer name;
    2. (data_type*) pointer _name;
    3. *(data type) pointer name;
    4. *(data_type)*pointer _name;
    Show Answer
    Answer :    Option ( B )
  33. Library functions which can be used for dynamic memory allocation are

    1. maloc() and caloc()
    2. alloc() and memalloc()
    3. malloc() and memalloc()
    4. malloc() and calloc()
    Show Answer
    Answer :    Option ( D )
  34. Which of the following statement is correct for: int *ptr, pnum:

    1. ptr and pnum, both are pointers to integer
    2. ptr is a pointer to Integer, pnum is not
    3. ptr and pnum both are not pointers to Integer
    4. ptr is a pointer to integer, pnum may or may not be
    Show Answer
    Answer :    Option ( B )
  35. Which one of the following is correct string initialization?

    1. char name[] = "LPU";
    2. char name[] = ( 'L', 'P', 'U', ’\0’ };
    3. char* nameptr = "LPU";
    4. all of above
    Show Answer
    Answer :    Option ( D )
  36. We can access union members as

    1. union_pointer--->member
    2. union_name. member
    3. union_name@ member
    4. both union pointer--->member and union_name. member
    Show Answer
    Answer :    Option ( B )
  37. Keyword used to define union in C is

    1. Union
    2. Uni o
    3. union (All small characters)
    4. None of above
    Show Answer
    Answer :    Option ( C )
  38. To free the memory allocated by malloc function, we can use

    1. free(ptr)
    2. free ptr;
    3. free(ptr);
    4. free ptr";
    Show Answer
    Answer :    Option ( A )
  39. Structure name is connected with its member name by using

    1. hyphen
    2. dot
    3. underscore
    4. none of above
    Show Answer
    Answer :    Option ( B )
  40. Keyword used to define structure in C is

    1. struct (all small characters)
    2. Struct
    3. Str
    4. structure
    Show Answer
    Answer :    Option ( A )
  41. To copy content of one string into another, we can use

    1. strcopy()
    2. stcpy()
    3. stringcopy()
    4. strcpy()
    Show Answer
    Answer :    Option ( D )
  42. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    char arr[] = "Computer Science";
    printf( %s", arr);

    1. Computer Science
    2. Compiler error
    3. Nothing will be printed
    4. Program will crash
    Show Answer
    Answer :    Option ( A )
  43. To copy a specific number of characters from one string to another, the function used is

    1. Stropy
    2. strncpy (all small characters)
    3. Strncpy
    4. strcpyn
    Show Answer
    Answer :    Option ( B )
  44. The return type of malloc() and calloc() functions is

    1. Int*
    2. Char*
    3. Float*
    4. Void*
    Show Answer
    Answer :    Option ( D )
  45. Extension of expanded source code file is

    1. .obj
    2. .i
    3. .s
    4. .exe
    Show Answer
    Answer :    Option ( B )
  46. C language was developed in

    1. 1970
    2. 1965
    3. 1972
    4. 1971
    Show Answer
    Answer :    Option ( A )
  47. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    Int a[5]=(7,32,30,48,51}; a[2]=a[1];
    a[3]=a[2];
    a[4]=a[3];
    printf( %d”,a[4]);

    1. 51
    2. 48
    3. 3O
    4. 32
    Show Answer
    Answer :    Option ( D )
  48. To insert an element in 1D array at a particular position, the considered index will be

    1. exact at position
    2. position+1
    3. position-1
    4. None of above
    Show Answer
    Answer :    Option ( B )
  49. If the size of 1D array is 50, then last index of the array will be

    1. 50
    2. 48
    3. O
    4. 49
    Show Answer
    Answer :    Option ( D )
  50. Pointer arithmetic can not be performed on

    1. Null pointer
    2. Wild pointer
    3. Void pointer
    4. Constant pointer
    Show Answer
    Answer :    Option ( A )
  51. Mach Number is the Ratio of -

    1. Inertia forces to Compressibility forces
    2. Inertia forces to viscous forces
    3. Inertia forces to Gravity forces
    4. Buoyancy forces to Inertia forces
    Show Answer
    Answer :    Option ( B )
  52. For dynamic memory allocation functions, we need to include

    1. memory.h
    2. stdli
    3. h
    4. stdio.h
    5. conio.h
    Show Answer
    Answer :    Option ( B )
  53. To join two words, which C function will be used?

    1. strcalt()
    2. strcon()
    3. strcat()
    4. merge()
    Show Answer
    Answer :    Option ( C )
  54. The format specifier used to print a string or character array in C is

    1. %S
    2. %c
    3. %s
    4. %C
    Show Answer
    Answer :    Option ( C )
  55. How the size of a union in C is determined?

    1. by the size of biggest member in union
    2. by the size of first member in union
    3. by the size of last member in union
    4. by summing the sizes of all members in union
    Show Answer
    Answer :    Option ( A )
  56. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    Int num 1 = 10, num2 = 20;
    Int *const ptr=&num1;
    printf("\n%d" "ptr);
    ptr=&num2
    printf( %d\n", "ptr);

    1. Error
    2. 10 20
    3. 10 20
    4. Infinite loop
    Show Answer
    Answer :    Option ( A )
  57. For dynamic memory allocation functies, we .........

    1. memory.h
    2. stdli
    3. h
    4. stdio.h
    5. conio.h
    Show Answer
    Answer :    Option ( B )
  58. What will be the output of the following code?
    int main()
    char arr1[10]="LPU";
    char arr2[5]; arr2= arr1; printf("%s",arr2);

    1. Compiler error
    2. LPU
    3. LPU\0
    4. None of above
    Show Answer
    Answer :    Option ( D )
  59. What will be the output of the following code?
    #incIude<stdio.h>
    int main()
    int *ptr1; char *ptr2; float *ptr3;
    printf("\n%d",sizeof(ptr1));
    printf("\n%d",sizeof(ptr2));
    printf("\n%d",sizeof(ptr3));

    1. 16 16 16
    2. 2 2 2
    3. 4 4 4
    4. 8 8 8
    Show Answer
    Answer :    Option ( D )

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !