C Programming and Problem Solving
Questions 81 to 90
81.
|
if a = 0x6db7 and b = 0xa726, what is the value of a^b;
(a) 0x58d9 (b) 0x1111 (c) 0xceb7 (d) 0x2526 (e) 0xca91.
|
82.
|
Consider
the following declerations
union id {
char color;
int size;
};
struct
{
char country;
int date;
union id;
}flag;
To assign a
color to a flag, the correct statement would be
(a) flag.color = ‘W’; (b) flag.id.color = ‘W’;
(c) flag.color = ‘WHITE’; (d) flag.id.color = ‘WHITE’;
(e) color.flag = ‘W’;
|
83.
|
Consider
the following declerations
enum
colors{black, blue, green };
This
represent
(a) black = 0,
blue = 1, green = 2
(b) color[1]=’black’, color[2]=’blue’,
color[3]=’green’
(c) color = ‘black’ or color = ‘blue’ or color = ‘green’
(d) black = -1, blue=0, green=1;
(e) Syntax error.
|
84.
|
The
function sprintf( ) works like printf(
), but operates on
(a) Data file (b) stderr (c) string
(d) stdin (e) no such function in ‘C’.
|
85.
|
The most
widely used method for interpreting the bit setting as non-negative integer
is
(a) EBCD system (b) BCD system (c) ASCII system
(d) Binary number system (e) EBCDIC system.
|
86.
|
Elements
of the array are accessed by
(a) Index (b) Mathematical function
(c) Accessing the function in built-in data
structure (d) int I;
(e) a[0].
|
87.
|
String
concatenation means
(a) Combining two strings
(b) Extracting a substring out of a string
(c) Partitioning the string into two strings
(d) Merging two strings
(e) Comparing the two strings to define the
larger one.
|
88.
|
malloc( )
function returns pointer to
(a) integer (b) void (c) character
(d) structure (e)
stack memory.
|
89.
|
# define
preprocessors command can be used for defining
(a) Macros (b) For loop (c) Symbolic constants
(d) Both (a) and (c) (e)
(a), (b) and (c).
|
90.
|
‘C’ is a
middle level language because
(a) It is evolved in Middle age of computer
development
(b) Not having so many features, but still is
robust
(c) Combines the best features of high, low
level languages
(d) Easier to learn and use
(e) Highly Portable.
|
Answers
81.
|
Answer : (e)
Reason : Because of the XOR ( ^ ) operator
|
82.
|
Answer : (b)
Reason : According to the concept of nested structures
|
83.
|
Answer : (a)
Reason : All the other are invalid
|
84.
|
Answer : (c)
Reason : According to the syntax and definition of
sprintf( )
|
85.
|
Answer : (d)
Reason : According to the ISO standards Binary number
system is used for this purpose.
|
86.
|
Answer : (a)
Reason : According to the definition of the arrays
|
87.
|
Answer : (a)
Reason : Concatenation means combining two strings
together ( appending the second at the end of first one )
|
88.
|
Answer : (b)
Reason : According to the syntax of malloc function
|
89.
|
Answer : (d)
Reason : As # define is the preprocessor directive, is
used for defining the symbolic constants, and defining the macros
|
90.
|
Answer : (c)
Reason : According to the features of ‘C’ language.
|
Bouncing Ball
ReplyDelete