WAP to print the address of a variables

Write a program to print the address of a variables

#include<stdio.h>
#include<conio.h>

void display(int,int);

int main() {
       int a,b;
       printf("Address of a = %u\n Address of b = %u\n",&a,&b);
       display(a,b);
       getch();
       return 0;
}

void display(int a, int b) {
       printf("Address of a = %u\n Address of b = %u\n",&a,&b);
}

Output

Address of a = 6422300
Address of b = 6422296
Address of a = 6422272
Address of b = 6422276

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments