Search This Blog

Thursday, October 13, 2011

Write a program to assign any value to any num and display the same through pointer

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  #include<stdlib.h>
   4:  void main()
   5:  {
   6:  int x,i;
   7:  int *a_x;
   8:  x=rand();
   9:  a_x=&x;
  10:  printf("x=%d\n",*a_x);
  11:  getch();
  12:  }

No comments:

Post a Comment