variable use NOTE 2: #include<stdio.h>/*1. The scope of the variable begins with the line of code that defines the variable and ends at the end of the code block 2. The function of code blocks to reclaim variables that are no longer in use, in order to improve performance*/intTest () {intv =Ten; return 0;}intMain () {{DoubleHeight =1.55; Height= height +1;//1.55+1printf"height=%f\n", height); //output value: 2.5500000 } intScore = -; { intScore = $; { intscore; Score= -; } printf ("score=%d\n", score); //Output Value:} printf ("score=%d\n", score)//Output Value: return 0;} Example: #include<stdio.h>intMain () {intA = -; intScore = a + -; printf ("%d\n", score); //Output Value: { intScore = -; {Score=Ten; printf ("%d\n", score); //output value: Ten} a=Ten; } {score= A + -; intScore = -; printf ("%d\n", score); //Output Value} printf ("%d\n", score); //output Value: 260 return 0;}
"Good Programmer's note sharing" C language variable use note