SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to print address of variable along with its value
C program to print address of variable along with its value
Input:
Enter an integer value:
10
Output:
The address of 'n' is bfbf916c
The value stored at bfbf916c is 10
Implementation:
#include
int main(void) { int n; printf("Enter an integer value:\n"); scanf("%d",&n); /* To print the address of the variable n or The address of value the user entered */ printf("The address of 'n' is %x\n",&n); /* To print the value stored in the variable n or The value stored at address &n */ printf("The value stored at %x is %d\n",&n,n); return 0; }
PREVIOUS
NEXT
HOME