Answer to Question #256266 in C++ for TAMOOR

Question #256266

Q: Write a program which defines three integer variables, var1, var2 and var3, & initializing them to the values 100, 200 & 300, it then prints out their addresses.



1
Expert's answer
2021-10-27T16:23:49-0400
#include<iostream>
using namespace std;
int main(){
	int var1=100;
	int var2 = 200;
	int var3 =300;
	cout<<"The address of var1 is: "<<&var1<<endl;
	cout<<"The address of var2 is: "<<&var2<<endl;
	cout<<"The address of var3 is: "<<&var3<<endl;
	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS