CSE101 Answer Key
CSE101 Answer Key
CSE101 Answer Key
A.
B. .exe
C. .S
D. obj
A. Abstraction
B. Simplicity
C. Correctness
D. Ambiguity
hi
A. Detect semantic error
at
B. Generate source code
C. Combine various object files and library files vH
D. Include the code of header files at the point, where they are included to general expanded
ra
source code
au
/S
/c
A. Export
B. Volatile
e.
C. Friend
ub
D. Number 1
ut
yo
exit
B. delete
C. break
D. None of above
U2-3 Which loop is guaranteed to execute at least once.
A. while.
B. do while
C. for
D. None of above
U2-5 Which will be the correct datatype of a variable used for storing the circumference of a circle?
hi
A. long int
at
B. short int
C. float vH
D. Int
ra
au
/S
B. Library Functions
C. Both User Defined and Library Functions
e.
A. Auto Function
B. Self Function.
C. Recursive Function
D. None of above
hi
#include<stdio.h>
at
Int main()
vH
ra
au
int a[3][2]={3,1},16,5},{2,7};
/S
Printf("%d", a[1][1]*a[2](1]};
/c
m
co
A. 10
e.
B. 35
ub
C. 12
ut
D. 42
yo
U4-2 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?
10
B. 12
C. 13
D. 11
#include <stdio.h>
int main()
A. 54321 garbage-value
B. 543
C.
543 210
D. Compile time error
hi
U4-5 To delete an element from a particular position of a 1D array, the considered index will be
at
A. position-1 vH
ra
B. position+1
au
C. Exact at position
D. None of above
/S
/c
m
#include<stdio.h>
int main()
ub
ut
int a[10], i;
yo
alil= i;
printf("%d", al5);
A.
6
B. 4
C. 5
D. Garbage value
A. Call by reference
B. Call by value
C. Call by structure
D. Call by array
U4-8 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?
A. 90 and 94
B. 90 and 99
C. 89 and 94
D. 89 and 99
U4-9 Consider 1D array as (5, 7, 20, 11, 9, 14). What value will be fetched for a[4]?
A. 9
3. 11
C. 14
D. 20
U4-10 For the array initialization as, int a[7] = {}; what value will be fetched for a[0]?
hi
at
A. Garbage Value
B. vH
C. -1
ra
D. 1
au
/S
/c
U5-1 A pointer that cannot be directly dereferenced and need to be correctly type-casted is called as
m
co
A. Constant pointer
B. Void pointer
e.
C. Dangling pointer
ub
D. None of above
ut
yo
#include<stdio.h>
int main()
int x=35,*p;
p=&x;
printf("n%d", *p);
A. Address of x
B. 35
C. Address of p
D. Garbage value
U5-3 Malloc and Calloc functions are used for
A. datatype ptrname;
B. datatype ptrname*;
C. datatype *ptrname;
D. datatype *(ptrname*);
U5-5 Type of pointer which points to a memory location which is already deleted or deallocated is
hi
A. Wild pointer
at
B. Dangling pointer
C. Void pointer vH
D. None of above
ra
au
/S
U5-6 A pointer which is not Initialized during its definition and holds some garbage value is called as
/c
m
A. Wild pointer
co
B. Null pointer
C. Dangling pointer
e.
D. Void pointer
ub
ut
yo
#include <stdio.h>
int main()
A. 15, 16
B. 16, 15
C. 16, 16
D. 15, 15
U5-8 The correct syntax of typecasting in void pointers is
A. (data_type*) pointer_name;
B. (datatype*) pointer _name;
C. *(data_type) pointer _name;
D. *(data_type)*pointer name;
U5-9 Library functions which can be used for dynamic memory allocation are
hi
int *ptr, pnum:
at
A. ptr and pnum, both are pointers to integer
B. ptr is a pointer to Integer, pnum is not
vH
ra
C. ptr and pnum both are not pointers to Integer
au
=
B. char name] {'L, P', 'U', "\0'
ub
D. all of above
yo
A. Union
B. Uni o
C. union small characters)
(All
D. None of above
U6-4 To free the memory allocated by malloc function, we can use
A. free(ptr)
B. free ptr;
C. free(ptr);
D. free ptr";
hi
A. struct (all small characters)
at
B. Struct
C. Str vH
D. structure
ra
au
/S
A. strcopy()
co
B. stcpy()
C.stringcopy()
e.
D. strcpy0
ub
ut
yo
#include<stdio.h>
int main()
A. Computer Science
B. Compiler error
C. Nothing will be printed
D. Program will crash
U6-9 To copy a specific number of characters from one string to another, the function used is
A. Stropy
B. strncpy (all small characters)
C. StrncPy
D. strcpyn
A. Int*
B. Char*
C. Float*
D. Void*
A. obj
B.
C. .S
D. .exe
hi
at
U1C language was developed in
vH
ra
A. 1970
au
B. 1965
/S
C. 1972
/c
D. 1971
m
co
e.
#include<stdio.h>
ut
yo
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]);
A.
51
B. 48
C. 30
D. 32
U4 To insert an element in 1D array at a particular position, the considered index will be
A. exact at position
B. position+1
C. position-1
D. None of above
U4 If the size of 1D array is 50, then last index of the array will be
A. 50
B. 48
C.
D. 49
hi
A. Null pointer
at
B. Wild pointer
C. Void pointer
D. Constant pointer
vH
ra
au
/S
B.
C. Inertia forces to Gravity forces
e.
A. memory.h
B. stdlib.h
C. stdio.h
D. conio.h
A. %5
B. %c
C. %s
D. %C
hi
D. by summing the sizes of all members in union
at
vH
ra
QWhat wll be the output of the following code?
au
#includestdio.h>
/S
int main(0
/c
m
co
printf("n%d" "ptr);
yo
ptr &num2
printf("%d\n", "ptr);
A. Error
B. 10 20
C. 10
20
D. Infinite loop
A. memory.h
B. stdlib.h
C. stdio.h
D. conio.h
char arr1[10]="LPU";
char arr2(51;
arr2 arr1;
printf( "%s",arr2);
A. Compiler error
B. LPU
hi
LPU\O0
at
C.
D. None of above vH
ra
au
#include<stdio.h>
/c
m
int main()
co
e.
ub
int *ptr1;
ut
char *ptr2;
yo
float *ptr3;
printf("n%d",sizeof(ptr1);
printf("n%d",sizeof(ptr2));
printf("n%d",sizeof(ptr3)};
A. 16 16 16
B. 222
C. 444
D. 88 8