#include<stdio.h>

int main(){

 double price=500;
 double year=5;
 double total;
 
 if(price==500)
 {
//????????????????????
    scanf("%f", &price);
    printf("%f\n", price);
 }
 
  total=(price * year);
    printf("%f\n", total);
}

why the scanf() can not get a new value from keyboard.
I want to give a new value to the price but the out put is
still 500.

#include<stdio.h>

int main(){

 double price=500;
 double year=5;
 double total;
 
 if(price==500)
 {
//?????????????????????????
    price=scanf("%f", &price);
    printf(" price=%f\n ", price);
 }
 
  total=(price * year);
    printf("total=%f\n ", total);
}

why do I get another value whit:price=scanf("%f", &price);

read your textbook about scanf() -- what does it return? It certainly does not return price, as indicated by your code. Your use of scanf() return value is wrong.