MCQ Single Best Answer Easy

QWhich of the following is the correct way to declare a pointer to an integer variable in C? int *x = &y;

ID: #7191 Pointer in C Language 364 views
Question Info
#7191Q ID
EasyDifficulty
Pointer in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A int x = &y;
  • B int *x = y;
  • C int &x = y;
  • D int *x = &y;
Correct Answer: Option D

Explanation

Answer: D

Explanation: The correct way to declare a pointer to an integer variable in C is to use the * operator in the declaration, and assign the address of the variable using the & operator.

Share This Question

Challenge a friend or share with your study group.