Professional Documents
Culture Documents
Subject:ACP Semester:2nd
1. What is meaning of following declaration ? int arr[20];
a. Array of Size 20
c. 50 40 30 20
d. None of Above
c. int n{6} = { 2, 4, 12 };
d. int n(6) = { 2, 4, 12, 5, 45, 5 };
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
c. 3
d. Theoretically no limit. The only practical limits are memory size and
compilers
void main()
int a[5]={2,4,8};
printf(“%d”,a[5]);
}
a. Garbage value
b. 8
c. 9
d. 0
b. 2-D Array
c. 3-D Array
d. 4-D Array
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
d. None of these
10. If we have declared an array int a[6], then which of the following array element is
considered as last array element ?
a. a[5]
b. a[6]
c. a[4]
d. None of Above
11. Array with last element 'n' will always have array size equal to _______.
a. n
b. n-1
c. n+1
d. n*n
b. Compile Time
c. Both a and b
d. None of Above
b. -1
c. 0
d. None of Above
15. When you assign a value to an array element whose subscript exceeds the array size,
What happens?
a. Program crashes
b. int anarray[10];
c. int anarray;
d. int anarray{10};
17. Which of the following will be used to accesses the 7th element stored in array?
a. array[5]
b. array[6]
c. array[7]
d. array[8]
18. If an array is declared as int a[10][10]; how many elements can it store?
a. 10
b. 20
c. 50
d. 100
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
19. Arrays are structures that hold multiple variables of the data type
a. int data type
c. Complex
d. None of Above
b. *
c. %
d. ^
c. Array
d. Floating
23. In order to fetch the address of the variable we write preceding _________ sign before
variable name.
a. ^
b. *
c. &
d. %
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
24. A pointer is
a. A keyword used to create variables
d. None of These
b. Address Operator
c. Conditional Operator
d. Bit-wise operator
int main()
{
int *ptr, a = 10;
ptr = &a;
*ptr += 1;
printf("%d,%d/n", *ptr, a);
}
a. 10,10
b. 10,11
c. 11,10
d. 11,11
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
b. *
c. ->
d. .
int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}
a. Same address
b. Different address
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf("%d%d%d\n", k, *p, **m);
}
a. 5 5 5
b. 5 5 junk value
c. 5 junk value
d. Run time error
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
31. Which of the following option is the correct way of declaring a float pointer:
a. float ptr
b. *float ptr
c. float *ptr
d. None of Above
}
a. h
b. hi
c. garbage value
d. Error
}
a. %s
b. CE
c. Error
d. No output
a. f is a pointer to integer
b. f is a pointer to float
c. f is a pointer to char
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
d. None of Above
a. None of Above
}
a. 11 11 10 10
b. 12 12 11 11
c. 10 10 10 10
d. 12 2 11 11
b. 4 byte
c. 8 byte
d. 2 byte
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
39. Pointer is a
a. Basic Data type
b. malloc
c. create
d. value
41. function is a
a. Basic Data type
c. power(2,X)
d. pow(X,2)
d. All of Above
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
b. Parenthesis
c. Square Braces
d. None Of Above
45. Which functions are used for only single character input/output ?
a. getchar( ) and putchar( )
b. scanf( ) and putchar( )
d. None of Above
47. The value obtained in the function is given back to main by using ________ keyword?
a. static
b. new
c. value
d. return
b. Itself
c. Another function
b. strproper
c. strlwr
d. strupr
b. 2.23
c. 2
d. 4
c. Full stop(.)
d. None of Above
b. string.h
c. stdio.h
d. conio.h
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
void main()
char name[]="Cppbuz";
int len;
int size;
len = strlen(name);
size = sizeof(name);
printf("%d,%d",len,size);
}
a. 0,0
b. 6,6
c. 7,7
d. 6,7
b. scanf( )
c. main()
d. printf()
c. 8
d. 7
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
b. Parallel order
c. Integer value
d. None of Above
b. Call by Address
c. Both a and b
d. None of Above
61. If the two strings are identical the strcmp( ) function returns.
a. 0
b. -1
c. 1
d. None of Above
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
62. C preprocessor
a. Takes care of conditional compilation
65. #include<stdio.h>
void main()
int i;
i = 64/(square(4));
printf("%d", i);
}
a. 16
b. 4
c. 64
d. None of Above
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
b. &
c. #
d. *
c. Compile time
d. None of Above
d. None of Above
c. Preprocessor directive
d. None of Above
b. printf('\n');
c. printf("\n");
d. printf("\\n");
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
d. None of Above
1.#undef
2.#if
3.#elif
4.#error
a. 1,2
b. 2,4
c. 1,2,3,4
d. 1,2,3
c. Files
d. Structure
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
struct employee
int emp_id;
double ph_no;
};
a. 100
b. 106
c. 108
d. 110
76. For accessing a structure elements using a pointer, you must use
a. Pointer Operator (& Operator)
b. Dot Operator (. Operator)
b. Union contain members of different data types which share the same
storage area in memory
c. Union is less frequently used in a program
d. Union are used for set operations
79. Which operator is used for connecting a structure name to its member name?
a. * operator
b. <- operator
c. . (dot) operator
d. & operator
union student
int n;
};
a. 18
b. 20
c. 22
d. 24
81. Which keyword is used to define the user defined data types?
a. def
b. type
c. typedef
d. union
c. Union is faster
d. Both b and c
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
b. no
c. Depends on Compiler
84. For binary files, a ___ must be appended to the mode string.
a. Nothing
b. “b”
c. “binary”
d. “01”
85. If there is any error while opening a file, fopen will return?
a. NULL
b. EOF
c. Depends on compiler
d. Nothing
b. A character string containing file pointer & the second argument is the mode
c. A character string containing the name of the file & the second argument
is the mode
d. All of above
int main()
int _ = 10;
int __ = 20;
printf("__%d",___);
return 0;
}
a. Compilation Error
b. Runtime Error
c. __0
d. __30
b. ‘w’ mode
c. ‘w+’ mode
d. ‘a+’ mode
b. .bin
c. .c
91. What is the meant by ‘a’ in the following operation? fp = fopen(“Random.txt”, “a”);
a. Attach
b. Append
c. Add
d. Apprehend
b. End of file
c. Move to the beginning of file
d. Move to desired position in file
94. Which function will return the current file position for stream?
a. fseek()
b. fsetpos()
c. fgetpos()
d. ftell()
d. Both a and b
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
d. 10
const charp P;
a. P is a constant
b. P is character type
c. P is a character constant
d. None of Above
b. close a file
c. write a file
d. read a file
101. The number of bytes required for enumerated data type in memory is
a. 1 byte
b. 2 byte
c. 3 byte
d. 4 byte
int main()
if(-5);
printf("C");
else
printf("C++");
return 0;
}
a. C
b. C++
c. C C++
d. Compile Error
j = &i;
k=i**j*i+*j;
a. 3
b. 27
c. 30
d. 9
a=5, b=10;
p1=&b, p2=&a;
c= *p1-*p2;
a. -5
b. -10
c. 10
d. 5
c. sum is a function which takes two int arguments and returns void
d. No comment
Faculty of Diploma Studies – 695
Department of Computer Engineering – 07
ACP MCQ Questions Bank
printf(“%d”,i);
a. 105
b. I
c. 73
d. i
#include<stdio.h>
c. During execution
d. During preprocessing
int a = 4, b = 6;
b. 0
c. 1
d. None of above