Saturday, September 24, 2016

C program to print Memory Addresses of Variables.

C Program to print Memory Addresses of Variables.

#include<stdio.h>
int main ()
{
  int rollno;
  char name[10];

  printf("Memory Address of rollno variable: %d\n", &rollno );
  printf("Memory Address of name variable: %d\n", &name );

  return 0;
}


Output of the Program:

Memory Address of rollno variable: 2293436
Memory Address of name variable: 2293426

Note: You may get different memory address on your computer.

* * * * *

No comments:

Post a Comment