Home
Current Affairs January 2024

What is the correct answer?

4

Identify the wrong statement

A. putchar(65)

B. putchar('x')

C. putchar("x")

D. putchar('
')

Correct Answer :

C. putchar("x")


Related Questions

What is the correct answer?

4

What will be output if you will compile and execute the following c code?


#include 
#define x 5+2
int main(){
int i;
i=x*x*x;
printf("%d",i);
return 0;
}


A. 27

B. 343

C. 233

D. Compiler Error

What is the correct answer?

4

Which one of the following is not a valid reserved keyword in C++

A. Explicit

B. Public

C. Implicit

D. Private

What is the correct answer?

4

# define PI = 8;' is the correct declaration of macros.

A. True

B. False

What is the correct answer?

4

The output of the following code is:
int f(int a, int b); 
void main()
{
int a = 12, b=154;
printf("%d", f(a, b));
}
int f(int a, int b)
{
if (a<b) return(f(b, a));
if(b==0) return(a);
return (f(b, a % b));
}

A. 2

B. 1

C. Compilation error

D. Runtime error

What is the correct answer?

4

Left shift operator rotates the bits on the left and places them to the right.

A. True

B. False

What is the correct answer?

4

The main() function can call itself recursively.

A. True

B. False

What is the correct answer?

4

A multidimensional array A[10][9] can store-------- number of elements

A. 91

B. 88

C. 90

D. 89

What is the correct answer?

4

The output of the following code is:
#define sqr(x= x*x) 
main()
{
int a = 10, b = 5;
printf("%d, %d", sqr(a+b),sqr(++a));
}

A. 77, 121

B. 225, 121

C. 77< 144

D. Compilation error

What is the correct answer?

4

do-while loop is useful when we want the statements within the loop must be executed

A. Only once

B. At least once

C. More than Once

D. Any one of the above

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

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

The value of an enumerated datatype can be read using scanf() function.

A. True

B. False

What is the correct answer?

4

The function fopen() on failure returns---------------------.

A. 0

B. NULL

C. 1

D. none of the above

What is the correct answer?

4

The output of the following code is:
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}

A. 21 21

B. 20 21

C. 21 20

D. 20 20

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

A continue statement causes execution to skip to

A. the return 0; statement

B. the first statement after the loop

C. the statement following the continue statement

D. the next iteration of the loop

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 size of signed integer is ------ bytes.

A. 4

B. 2

C. 8

D. 10

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 output of the following code is:
void main() 
{
static int a = 1, b, c;
if (a>=2) b=2; c=3;
printf("%d\t%d", b,c);
}

A. 2 3

B. 0 3

C. 0 0

D. 2 0

What is the correct answer?

4

Which of the following is not a standard exception built in C++.

A. std::bad_creat

B. std::bad_alloc

C. std::bad_cast

D. std::bad_typeid

What is the correct answer?

4

perror( ) function used to ?

A. Work same as printf()

B. prints the error message specified by the compiler

C. prints the garbage value assigned by the compiler

D. None of the above

What is the correct answer?

4

unsigned' is a valid variable name.

A. True

B. False

What is the correct answer?

4

void' is a datatype.

A. True

B. False

What is the correct answer?

4

A pointer is an indication of the variable to be accessed next.

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

What is the correct answer?

4

If 'str' is a string of 7 characters, the statement printf("%4s", str); will display ------characters.

A. 4

B. 7

C. 6

D. 0

What is the correct answer?

4

Which of the following is an example of compounded assignment statement?

A. a = 5

B. a += 5

C. a = b = c

D. a = b

What is the correct answer?

4

The output of the following code is:
main() 
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}

A. 0

B. 5

C. Error

D. None of the above

What is the correct answer?

4

Which one of the following is not a fundamental data type in C++

A. float

B. string

C. int

D. wchar_t