Â
In this, we are going to see how to print the Memory Address of a variable storing a Decimal Value in C++ Programming Language.
The Code given below can be used for TURBO C++ Compilers: -
//C++ program to print address of the float number.
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
float *p, num;
cout << "Enter a number:-\n";
cin >> num;
p = #
cout << "Address of entered number is:- " << p;
getch();
}
//...........Coded by YASH ALAPURIA
The Code given below can be used for gcc/g++ Compilers: -
//C++ program to print address of the float number.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
system("cls");
float *p, num;
cout << "Enter a number:-\n";
cin >> num;
p = #
cout << "Address of entered number is:- " << p;
return 0;
}
//...........Coded by YASH ALAPURIA
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP