Home
Current Affairs January 2024

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

Correct Answer :

B. Logical error


Related Questions

What is the correct answer?

4

In the expression - 'x + y + 3z =20'

A. x + y' is a keyword

B. 3 and 20 are constants

C. 3z is a constant

D. y is a variable and z is a constant

What is the correct answer?

4

The same variable names of automatic type can be used in different functions without any conflict.

A. True

B. False

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

What is Keywords?

A. Keywords have some predefine meanings and these meanings can be changed.

B. Keywords have some unknown meanings and these meanings cannot be changed.

C. Keywords have some predefine meanings and these meanings cannot be changed.

D. None of the above

What is the correct answer?

4

Which of the following keyword supports dynamic method resolution?

A. abstract

B. Virtual

C. Dynamic

D. Typeid

What is the correct answer?

4

What is C Tokens?

A. The smallest individual units of c program

B. The basic element recognized by the compiler

C. The largest individual units of program

D. A & B Both

What is the correct answer?

4

the value *(&i) is same as printing the value of address of i.

A. True

B. False

What is the correct answer?

4

Character data types cannot be declared as unsigned.

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

The output of the following code is:
main() 
{
unsigned int a = 10;
while (a>=10)
{
int a; a-- ;
}
printf("%i", a);
}

A. Infinite loop

B. 9

C. 0

D. None

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

Nested macros are allowed.

A. True

B. False

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

A recursive function calls itself again and again.

A. True

B. False

What is the correct answer?

4

How many times the following loop will execute?
for (a = 0; a < 4; a++)
printf("hello
");

A. 3

B. 4

C. 5

D. infinite

What is the correct answer?

4

What is an array?

A. An array is a collection of variables that are of the dissimilar data type.

B. An array is a collection of variables that are of the same data type.

C. An array is not a collection of variables that are of the same data type.

D. None of the above.

What is the correct answer?

4

printf() is not a library function.

A. True

B. False

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

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 invalid?

A. ''

B. " "

C. 'a'

D. abc'

What is the correct answer?

4

Which of the following expressions is wrong

A. float a =123.56;

B. char ch ='T' * 'A';

C. char ch ='T' *20;

D. 3 +a = b;

What is the correct answer?

4

What does STL stand for?

A. Simple Template Library

B. Standard Template Library

C. Static Type Library

D. Single Type-based Library

What is the correct answer?

4

For 16bit compiler allowable range for integer constants is ______ ?

A. 3.4e38 to 3.4e38

B. 32767 to 32768

C. 32768 to 32767

D. 32668 to 32667

What is the correct answer?

4

Which of the following is allowed in a C Arithmetic instruction

A. []

B. {}

C. ()

D. None of the above

What is the correct answer?

4

No commas or blanks are allowed within an integer or a real constant.

A. True

B. False

What is the correct answer?

4

char *s[10] defines an array of ------------------------

A. pointers to strings

B. string to pointer

C. both

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

The output of the following code is:
void main() 
{
char a = 'B';
switch (a)
{
case 'A' : printf("a");
case 'B' : printf("b");
default : printf("c");
}

A. B

B. b

C. bca

D. bc

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 default initial value of automatic storage class is 0.

A. True

B. False