An array is defined with the following statement in a file, file1.c int a[ ] = { 1, 2, 3, 4, 5, 6 }; In another file, file2.c, the following code snippet is written to use the array a: e...
The size of the operator cannot be applied to an array 14.0%
There is nothing wrong with the code snippet. The value of the size will be 6 0.0%
There is nothing wrong with the code snippet. The value of the size will be 7 0.0%
An extern array of unspecified size is an incomplete type. The size of the operator during compile time is unable to learn the size of an array that is defined in another file 85.0%
None of the above 0.0%
By which file function you can position the file pointer in accordance with the current position?
ftell() 0.0%
fseek() 100.0%
fgetc() 0.0%
fread() 0.0%
fscanf() 0.0%
Consider the following code. int i = 4, *j, *k; Which one of the following statements will result in Compilation error?
j = &i; 0.0%
j = j + 4; 0.0%
j = j - 2; 0.0%
k = j + 3; 0.0%
j = j * 2; 100.0%
From which of the following loop or conditional constructs, is "break" used for an early exit?
switch 0.0%
for 0.0%
while 20.0%
do-while 0.0%
All of the above 80.0%
Given the array: int num[3][4]= { {3,6,9,12}, {15,25,30,35}, {66,77,88,99} }; what would be the output of *(*(num+1))?
3 0.0%
15 100.0%
66 0.0%
6 0.0%
25 0.0%
Given the array: int num[3][4]= { {3,6,9,12}, {15,25,30,35}, {66,77,88,99} }; what would be the output of *(*(num+1)...
3 0.0%
15 0.0%
26 75.0%
66 0.0%
77 25.0%
Given the following array declaration: int a[2][3][4]; what would be the number of elements in array a?
24 100.0%
22 0.0%
20 0.0%
12 0.0%
36 0.0%
Given the following array: char books[][40]={ "The Little World of Don Camillo", "To Kill a Mockingbird", "My Fam...
m 100.0%
M 0.0%
F 0.0%
i 0.0%
L 0.0%
Given the following array: int a[8] = {1,2,3,4,5,6,7,0}; what would be the output of printf("%d",a[4]); ?
3 0.0%
4 0.0%
5 100.0%
6 0.0%
7 0.0%
Given the following array: char books[][40]={ "The Little World of Don Camillo", "To Kill a Mockingbird", "My Famil...
Birds 0.0%
B 0.0%
Birds, Beasts and Relatives 100.0%
My Family and Other Animals 0.0%
M 0.0%
Given the operators: 1) * 2) / 3) % What would be the order of precedence?
1,2,3 0.0%
1,3,2 0.0%
3,2,1 0.0%
All have the same precedence 33.0%
1 and 2 have the same precedence, 3 is of lower precedence 66.0%
Identify the incorrect statement.
Records can be defined in C by using structures 0.0%
Structure members can be of the same/different data types 25.0%
Memory is reserved when a structure label is defined 75.0%
A pointer to a structure can be used to pass a structure to a function 0.0%
Arrays of structures can be defined and initialized 0.0%
If a two dimensional array arr[4][10](an array with 4 rows and 10 columns) is to be passed in a function, which of the following would be the valid parameters in the function definition?
fn(int arr[4][10]) 100.0%
fn(int arr[][10]) 0.0%
fn(int arr[4][]) 0.0%
fn(int (*fn)[13]) 0.0%
None of the above 0.0%
In order to read structures/records from a file, which function will you use?
fscanf() 50.0%
fread() 50.0%
fgets() 0.0%
fgetc() 0.0%
fseek 0.0%
In which area of memory are static variables allocated?
stack 0.0%
heap 75.0%
With the code binary 0.0%
None of the above 25.0%
Is the following statement correct? If not, why not? If yes, what is the size of the array? int array[][3] = { {1,2}, {2,3}, {3,4,2} };
Yes, the size is three columns by two rows 50.0%
Yes, the size is two columns by two rows 0.0%
No, the first dimension is omitted 0.0%
No, one of the three initializer sets contains too many numbers 0.0%
Yes, the size is three columns by three rows 50.0%
Read the following two declaration statements. 1. #include <stdio.h> 2. #include "stdio.h" Which of the following statements pertaining to the above two statements are correct?
For statement 1, the header file will be searched first in the local directory and then in the standard system directories such as "/usr/include" 0.0%
For statement 1, the header file will be searched in the standard system directories such as "/usr/include" 50.0%
For statement 2, the header file will be searched first in the local directory and then in the standard system directories such as "/usr/include" 50.0%
For statement 2, the header file will be searched in the standard system directories such as "/usr/include" 0.0%
None of the above 0.0%
Read the statement below: extern int a; Which of the following statement/s pertaining to the above statement is/are correct?
Declares an integer variable a; Allocates storage for the variable 16.0%
Declares an integer variable a; Does not allocate the storage for the variable 33.0%
Indicates that the variable is defined outside the current file 0.0%
Brings the scope of the variable defined outside the file to this file 50.0%
All of the above 0.0%
None of the above 0.0%
Suppose there is a file a.dat which has to be opened in the read mode using the FILE pointer ptr1, what will be the correct syntax?
ptr1 = open("a.dat"); 0.0%
ptr1 = fileopen("a.dat"); 0.0%
ptr1 = fopen("a.dat","r"); 100.0%
ptr1 = open("a.dat","r"); 0.0%
ptr1 = fileopen("a.dat","r"); 0.0%
The declaration int (*p[5])() means:
p is an array of pointers to functions the return type of which is an integer 50.0%
p is a pointer to a function that returns a pointer to an integer 0.0%
p is a pointer to an array of integers 50.0%
p is a pointer to an array of integer pointers 0.0%
p is a pointer to a character string 0.0%
The declaration int *(*p)[10] indicates:
p is an array of pointers to functions the return type of which is an integer 0.0%
p is a pointer to a function that returns a pointer to an integer 0.0%
p is a pointer to an array of integer pointers 100.0%
p is a pointer to a character string 0.0%
What does the argv[0] represent?
The first command line parameter has been passed to the program 0.0%
The program name 100.0%
The number of command line arguments 0.0%
None of the above 0.0%
What does the following function do? int fn(unsigned int x) { int count = 0; for(; x!=0; x&=(x-1)) count++; return count; }
Returns the minimum number of bits required to represent the number x 0.0%
Returns the number of zero bits present in the number x 0.0%
Returns the number of 1 bits(bits having one) in the number x 100.0%
Returns the square root of the number 0.0%
None of the above 0.0%
What is the function to concatenate two strings?
strcmp() 0.0%
strcpy() 0.0%
strcat() 100.0%
strlen() 0.0%
catstr() 0.0%
What is the output of the following program ? main() { int u = 1, v = 3; printf("%d %d",u,v); funct1(&u,&v); printf(" %d %d
",u,v); } void funct1(int *pu, int *pv) { *pu=0; *pv=0; return; }
1 3 1 3 0.0%
1 3 1 1 0.0%
1 3 0 0 100.0%
1 1 1 1 0.0%
3 1 3 1 0.0%
What is the return type of the following function declaration? func(char c);
void 0.0%
char 0.0%
int 0.0%
undefined 100.0%
What is the return value in case a file is not opened successfully by using fopen()?
0 0.0%
1 0.0%
100 0.0%
NULL 100.0%
What is wrong with the following function prototype statement? int func();
The function definition {...} is missing 0.0%
While calling a function, the type int is not needed 50.0%
No parameter has been passed 0.0%
The semicolon should not be there 0.0%
There is nothing wrong with the statement 50.0%
What will be printed on the standard output as a result of the following code snippet? int funr(int x, int y) { if(x <= 0) { return y; } else ...
2 0.0%
3 0.0%
5 100.0%
6 0.0%
9 0.0%
What will be printed on the standard output as a result of the following code snippet? main() { int num = 425; printf("%d", printf("%d", num)); }
Will result in Compilation Error 0.0%
4425 0.0%
4253 100.0%
3435 0.0%
None of the above 0.0%
What will be printed on the standard output as a result of the following code snippet? void main() { char arr[] = {'R','A','M','