C - Files and Preprocessors Questions and Answers
Practice ModeShowing 10 of 96 questions
Q91
What is the output of the following code ?
enum alphanum
{
VARIABLE=S, DIGIT=10, VARIABLE=11
};
PRINTF("%D", DIGIT);
Answer: Option A
Q92
What is the output of the following code ?
enum control
{
on, off, neutral
};
PRINTF ("%d", off);
Answer: Option A
Q93
identify the correct statement.
1. The typedef defines synonyms for a an existing data type.
2. the typedef creates a new data type that is not existing in C.
3. the typedef helps in easier modification of a portable program.
4. The typedef gives meaningful namels to a data type.
Answer: Option A
Q94
Identify the valid data type of the variable fraction in the following code.
typedef float HOST;
HOST fraction;
Answer: Option B
Q95
Given the following declaration, identify the correct definition.
typedef struct node
{
int id;
char name [20];
};
Answer: Option B
Q96
The purpose of the following code is no find
#include < time..
main ()
{
time _t t1, t2;
clock _t clock (void)
int i,x=0, y=10;
for(i=0; i<1000; i++)
{
xc++; y+=50;
printf ("The value of i=%d, x = %d, y = %d\n", i, x, y);
}
t2 = clock ( ) ;
printf ("Time in seconds :%g\n", difftime(t2,t1)/ CLOCKS_PER_SEC);
}
Answer: Option B