C Programming and Problem Solving
Questions 201 to 210
201.
|
Identify
the wrong expression for the given
integer array ‘a’ as “int a[10];” [ In Turbo C compiler].
|
||||||||||
What is
the value of a[0][2] in int a[3][4]={{1,2},{3,4,5}};?
|
|||||||||||
The
parameters in a function definition are known as
|
|||||||||||
The
function used to position the file pointer in C is
|
|||||||||||
int
*p[5]; is used for
|
|||||||||||
The
declaration int (*a)[8]; is
|
|||||||||||
What is the
value of ‘f’ after execution of the following code?
float f = 1/4.0 + 1/4;
|
|||||||||||
What is the
value of ‘ptr’ after the execution of the following code?
int *const
ptr = 5;
Now if
the address of ‘ptr’ is 2000, then ptr-- is
|
|||||||||||
To read the
formatted input data from a file, which of the following function is used?
|
|||||||||||
The arguments
in main() function are known as
|
Answers
201.
|
Answer : (e)
Reason : The
remaining option are valid in C, but the increment operation cannot be
performed on array in C.
|
Answer : (a)
Reason : As
the remaining unassigned elements of the array are initialized with 0. So
a[0][2] is first row’s third element which is zero.
|
|
Answer : (c)
Reason : According
to C terminology they are known as formal parameters and the operators in
function call are known as actual parameters or arguments.
|
|
Answer : (e)
Reason : The
remaining all the options are not for the required operation on random
accessing of files.
|
|
Answer : (a)
Reason : Because
it is an array of 5 integer pointers, where every integer pointer can point
to integer quantities later on, may be of same or varying size.
|
|
Answer : (b)
Reason : Whenever
it is casted as (*a)[…] then it is always a pointer to array.
|
|
Answer : (d)
Reason : 1/4.0
is 0.25 and 1/4 is 0 only ( Because of integer division )
|
|
Answer : (e)
Reason : As
‘ptr’ is a constant pointer and hence cannot be changed.
|
|
Answer : (c)
Reason : scanf()
is the function to read the formatted input data but from console, where as
fscanf() is the function to read the formatted input data from the files.
|
|
Answer : (d)
Reason : Because
the Command line arguments and program parameters are same.
|
thank you.
ReplyDeletec++ tutorial
java tutorial