Home
Current Affairs January 2024

What is the correct answer?

4

All macro substitutions in a program are done before compilation of the program.

A. True

B. False

Correct Answer :

A. True


Related Questions

What is the correct answer?

4

Which classes allow primitive types to be accessed as objects?

A. Storage

B. Virtual

C. Friend

D. Wrapper

What is the correct answer?

4

static variable will not always have assigned value.

A. True

B. False

What is the correct answer?

4

All elements of a structure are allocated contiguous memory locations.

A. True

B. False

What is the correct answer?

4

strcat() function ----------------------- two strings.

A. delete

B. concatenate

C. compare

D. none of the above

What is the correct answer?

4

What's wrong? (x = 4 && y = 5) ? (a = 5) ; (b = 6);

A. the question mark should be an equal sign

B. the first semicolon should be a colon

C. there are too many variables in the statement

D. the conditional operator is only used with apstrings

What is the correct answer?

4

The output of the following code is:
main() 
{
xyz: goto abc;
printf("Hello");
abc: printf("World");
goto xyz;
}

A. Infinite loop

B. Hello World

C. World Hello

D. Compilation error

What is the correct answer?

4

There are total ------ numbers of operators in 'C'.

A. 35

B. 45

C. 55

D. 40

What is the correct answer?

4

The statement "for (i = 0, j = 2; j <= 10; j++)" is a valid statement in 'C'.

A. True

B. False

What is the correct answer?

4

Each pass through a loop is called a/an

A. enumeration

B. iteration

C. culmination

D. pass through

What is the correct answer?

4

The-------------------- statement helps immediate exit from any part of the loop

A. break

B. continue

C. exit

D. All of the above

What is the correct answer?

4

Which of the following is not an infinite loop

A. int i =1;
while (1)
{i++;}

B. for( ; ; );

C. int true=0< false;
while (true)
{false = 1;}

D. int y, x = 0;
do
{y = x;}
while (x==0);

What is the correct answer?

4

The printf() function retunes which value when an error occurs?

A. Positive value

B. Zero

C. Negative value

D. None of these

What is the correct answer?

4

The output of the following code is:
main() 
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}

A. 0

B. Nothing will be displayed

C. Infinite loop

D. None of the above

What is the correct answer?

4

gets() and puts() are unformatted I/O functions.

A. True

B. False

What is the correct answer?

4

The output of the following code is:
void main() 
{
int a = 0;
while (a<=50) for(;;) if(++a % 50==0) break;
printf("a = %d", a);
}

A. a = 100

B. a = 50

C. compilation error

D. runtime error

What is the correct answer?

4

The output of the following code is:
main() 
{
int a[10], i;
for (i = 1; I <= 0; i++)
{
scanf("%d", a[i]);
printf("%d", a[i]);
}
}

A. 10

B. Logical error

C. Runtime error

D. 1 to 10 will be displayed

What is the correct answer?

4

An array declared as A[100][100] can hold a maximum of 100 elements.

A. True

B. False

What is the correct answer?

4

C is a ___ language

A. High Level and Procedural

B. Low Level and OOPS

C. Middle Level and Procedural

D. Machine Level and OOPS

What is the correct answer?

4

What is right way to Initialization array?

A. int num[6] = { 2, 4, 12, 5, 45, 5 } ;

B. int n{} = { 2, 4, 12, 5, 45, 5 } ;

C. int n{6} = { 2< 4< 12 } ;

D. int n(6) = { 2, 4, 12, 5, 45, 5 } ;

What is the correct answer?

4

When is std::bad_alloc exception thrown?

A. When new operator cannot allocate memory

B. When alloc function fails

C. When type requested for new operation is considered bad<  thisexception is thrown

D. When delete operator cannot delete teh allocated (corrupted) object

What is the correct answer?

4

Which header file is essential for using strcmp() function?

A. string.h

B. strings.h

C. text.h

D. strcmp.h

What is the correct answer?

4

Which of the following is the most preferred way of throwing and handling exceptions?

A. Throw by value and catch by reference.

B. Throw by reference and catch by reference.

C. Throw by value and catch by value

D. Throw the pointer value and provide catch for teh pointer type.

What is the correct answer?

4

What is the difference between overloaded functions and overridden functions?

A. Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding

B. Redefining a function in a friend class is called function overriding while Redefining a function in a derived class is called a overloaded fucntion.

C. Overloading is a static or compile-time binding and Overriding is dynamic or run-time binding

D. Redefining a function in a friend class is called function overloading while Redefining a function in a derived class is called as overridden fucnion.

What is the correct answer?

4

An array elements are always stored in _________ memory locations.

A. Sequential

B. Random

C. Sequential and Random

D. None of the above

What is the correct answer?

4

fopen() function returns a pointer to the open file.

A. True

B. False

What is the correct answer?

4

Which of the following is not true about preprocessor directives

A. They begin with a hash symbol

B. They are processed by a preprocessor

C. They form an integral part of the code

D. They have to end with a semi colon

What is the correct answer?

4

The output of the following code is:
void main() 
{
int a;
int &b = a;
a=100;
printf("b=%d\ta=%d
", b,a);
}

A. b=100 a=100

B. b=100 a=0

C. b=0 a=100

D. Error

What is the correct answer?

4

What's wrong? for (int k = 2, k <=12, k++)

A. the increment should always be ++k

B. the variable must always be the letter i when using a for loop

C. there should be a semicolon at the end of the statement

D. the commas should be semicolons

What is the correct answer?

4

Right shifting an operand 1bit is equivalent to multiplying it by 2.

A. True

B. False

What is the correct answer?

4

unsigned char has a range from 0 to ------------

A. 253

B. 254

C. 255

D. 256