MCQ Practice Single Best Answer Topic: Pointer in C Language

Q What is the output of this program?

#include<stdio.h>
int main(){
    const int *p;
    int a=10;
    p=&a;
    printf("%d",*p);
    return 0;
}

Question ID
#899
Subchapter
Pointer in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 1
  • B Compiler Error
  • C 10
  • D Garbage value
Correct Answer: C

Explanation

In the following declaration


 const int *p; 

p can keep address of constant integer.

Share This Question

Share this MCQ with your friends or study group.