4

# What is the right way to access value of structure variable book{ price, page }?

printf("%d%d", book.price, book.page);

printf("%d%d", price.book, page.book);

printf("%d%d"< price::book< page::book);

printf("%d%d", price>book, page>book);

A. printf("%d%d", book.price, book.page);

4

# What is right way to Initialization array?

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

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

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

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

4

b=100 a=100

b=100 a=0

b=0 a=100

Error

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]); }}

10

Logical error

Runtime error

1 to 10 will be displayed

4

const X* const

X* const

X*

X&

4

True

False

4

2 3

0 3

0 0

2 0

4

# Which of the following is allowed in a C Arithmetic instruction

[]

{}

()

None of the above

4

True

False

4

do-while

if-else

goto

for

4

Positive value

Zero

Negative value

None of these

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));}

77, 121

225, 121

77< 144

Compilation error

4

True

False

4

Dennis Ritchie

Ken Thompson

Bill Gates

Peter Norton

4

# The output of the following code is:void change (char *k) {k="Hello";return; } main() { char *ch = "World";;change(ch); printf("%s", ch); }

Hello

World

Compilation error

Hello World

4

True

False

4

200

500

30

Unpredictable

4

True

False

4

True

False

4

Infinite loop

9

0

None

4

True

False

4

True

False

4

True

False

4

True

False

4

# continue statement is used

to go to the next iteration in a loop

come out of a loop

restarts iterations from beginning of loop

4

# What's wrong? while( (i < 10) && (i > 24))

the logical operator && cannot be used in a test condition

the while loop is an exit-condition loop

the test condition is always true

the test condition is always false

4

enumeration

iteration

culmination

pass through

4

True

False

4

A

B

BCPL

C++

4

float

string

int

wchar_t