See Our team

Wondering how we keep quality?

Got unsolved questions?

Ask Questions

Engineering
GATE
CBSE
NCERT
Psychology
English
Computer
Constitution
Astrology
Yoga
Economics
Physics
Biology
Electronics
Microprocessor
Career
Interview
Anatomy
Botany

Gate-cs-2016-->View question

By:13priya

Taged users:

Likes:

Be first to like this question

Dislikes:

Be first to dislike this question

Talk about thisDelete|Like|Dislike|

Aparna-Dasgupta

Likes:

Be first to like this answer

Dislikes:

Be first to dislike this answer

Talk about this|Once you have earned teacher badge you can edit this questionDelete|Like|Dislike|

------------------------------------

## Consider the following C program. void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; // call to f() } Which one of the following expressions, when placed in the blank above, will NOT result in a type checking err

(A) f(s,*s)

(B) i = f(i,s)

(C) f(i,*s)

(D) f(i,*p)

By:13priya

Taged users:

Likes:

Be first to like this question

Dislikes:

Be first to dislike this question

Talk about thisDelete|Like|Dislike|

## Answers

**Answer is: f(i,*p)**

Explanation: i is integer and *p is value of a pointer to short.

1) f(s, *s) is wrong because we are passing ā*Sā as second argument check that S is not a pointer variable .So error

2) i=f(i, s) is we are trying to store the value of f(i,s) into i but look at the function definition outside main it has no return type. It is simply void so that assignment is wrong. So error

3) f(i, *s) is wrong because of the same reason why option 1 is wrong

4) So the option f(i, *p) is correct.

Aparna-Dasgupta

Likes:

Be first to like this answer

Dislikes:

Be first to dislike this answer

Talk about this|Once you have earned teacher badge you can edit this questionDelete|Like|Dislike|

------------------------------------

## Use Me ?