pointers q 1

 


  1. Write a program having a variable i. Print the address of i. Pass this variable to a function and print its address. Are these addresses same? Why?



#include <stdio.h>


int address( int a ){

    int *j =&a;

    printf(" Address of %p is %p \n", a , &a);

    return;

}


int main() {

    // Write C code here

    int i = 5 , p ;

    int *j = &i ;

    printf (" address of %d is %p \n", i , j);

    p=address(j);

    printf("%p\n", p );

    

    

   

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings