C - Files and Preprocessors
C - Files and Preprocessors
91. What is the output of the following code ?
enum alphanum
{
VARIABLE=S, DIGIT=10, VARIABLE=11
};
PRINTF("%D", DIGIT);
enum alphanum
{
VARIABLE=S, DIGIT=10, VARIABLE=11
};
PRINTF("%D", DIGIT);
- Compilation error
- Execution error
- 10
- 6
92. What is the output of the following code ?
enum control
{
on, off, neutral
};
PRINTF ("%d", off);
enum control
{
on, off, neutral
};
PRINTF ("%d", off);
- Compliation error
- Execution error
- 5
- 1
93. 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.
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.
- options 1, 3 and 4
- options 1 and 4
- options 2 and 3
- options 2, 3 and 4
94. Identify the valid data type of the variable fraction in the following code.
typedef float HOST;
HOST fraction;
typedef float HOST;
HOST fraction;
- int and HOST
- struct and HOST
- enum and HOST
- float and HOST
95. Given the following declaration, identify the correct definition.
typedef struct node
{
int id;
char name [20];
};
typedef struct node
{
int id;
char name [20];
};
- node n;
- NODE n;
- typedef NODE n;
- typedef node n;
96. 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);
}
#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);
}
- compilation time
- execution time
- difference between GST and IST
- difference between compilation and execution times.