• Source
    1. #include <stdio.h>
    2.  
    3. int main(void) {
    4. volatile unsigned int temp = 10;
    5.  
    6. if( temp == 10 )
    7. {
    8. temp = 30;
    9. }
    10.  
    11. // sometimes you may use assignment operator instead of comparision.
    12. // this may not generate any warning and can result in nasty rutime issue.
    13. // below if condition is always.
    14. if( temp = 10 )
    15. {
    16. temp = 40;
    17. }
    18.  
    19. printf("value of temp : %d \n", temp );
    20. }
    21.