Q. What will be the output of the following code?

Code:
#include <stdio.h>
int main() {
    int x = 10;
    int *p = &x;
    printf("%d", *p);
    return 0;
}
  • (A) 10
  • (B) Address of x
  • (C) Error
  • (D) Garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10
Explanation: *p gives the value stored at the address of x, which is 10.
Explanation by: Mr. Dubey
*p gives the value stored at the address of x, which is 10.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
92
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate