Answer to Question #256435 in C++ for TAMOOR

Question #256435

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-30T10:37:13-0400
#include <iostream>

int main()
{
    int var1 = 100;
    int var2 = 200;
    int var3 = 300;

    std::cout << "&var1 = " << &var1 << '\n';
    std::cout << "&var2 = " << &var2 << '\n';
    std::cout << "&var3 = " << &var3 << '\n';
}

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