#include<stdio.h>
int a=10;
main()
{
int a=20;
printf ("%d",a);
}
question : output of the code is a=20 but i want also print the old value of a (10), with out using pointers ? or suggest me other possible methods too...
1
Expert's answer
2014-09-25T09:42:56-0400
#include<stdio.h> #include<stdlib.h> //value a int a=10; //main method void main(){ int a=20; //print 20 printf ("%d\n",a); //print 10 printf ("%d\n",::a); //delay system("pause"); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Thank you! We've corrected answer and category.
no u should do this with SRO(scope resolution operator) then u can also access also the old value of variable(a)
Leave a comment