Wednesday 3 June 2020

UGC NET Computer Science December 2019 | Question 122

Question 122
Which of the following are legal statements in C programming language?
(a) int * P= &44 ;
(b) int * P= &r ;
(c) int P= &a ;
(d) int P= a ;
Choose the correct option :
  1. 1. (a) and (b)
  2. 2. (b) and (c)
  3. 3. (b) and (d)
  4. 4. (a) and (d)
Answer : 3. (b) and (d)

Explanation Question 122

Legal Statements:
  • int *P = &r;     Here, Pointer variable P is storing address of variable r.
  • int P = a;          Here, P will hold value assigned by a.
Illegal Statements:
  • int *P = &44;     Here, Pointer variable is storing address of number. This is not legal statement. First its needed to assign the value 44 in some variable and then address of that variable can stored by Pointer variable P.   
  • int P = &a;    Here, P variable trying to store the address of the variable. It's illegal. It should be pointer in place of the int P variable.
So, option 3 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 121UGC NET CS December 2019 - Question 123

2 comments:

  1. UGC NET Coaching in Chandigarh – Gyan Sagar Institute, Sector-34/A, Chandigarh. We are Offer UGC-NET Coaching Center in Chandigarh. Expert faculties help to become master of a particular subject and become eligible for lectureship and make their future secure.

    ReplyDelete
  2. Gyan Sagar Institute is considered as the Best UGC-NET Coaching Center in Chandigarh Sector-34/A. We not only focus on theory but also on practical knowledge. The main focus is on quality.

    ReplyDelete

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts