How do i do decrements in C language? : If an example , i set a value of :

    a = 50 

How do i do a decrement whereby a always decreases by 2 ? An example :

    48
    46
    44
    42
    40

Whereby the return results , i can use as a variable. Example in the case below , this method is to get temperature at random. But i would like it to decrease so that i can call this get temperature method even below for it to loop.

    /* Retrieves current temperature. */
    static int32_t get_temperature_sample(void)
    {
        /* For the sake of example, random data is used */
        return rand() % 10 + 25;
    }
    
    /* Periodically called by Kaa SDK. */
    static void example_callback(void *context)
    {
        time_t current_time = time(NULL);
    
        /* Respect sample period */
        if (difftime(current_time, last_sample_time) >= sample_period) {
            int32_t temperature = get_temperature_sample();
    
            printf("Sampled temperature: %i\n", temperature);
            last_sample_time = current_time;
    
            kaa_user_log_record_t *log_record = kaa_logging_data_collection_create();
            log_record->temperature = temperature;
    
            kaa_logging_add_record(kaa_client_get_context(context)->log_collector, log_record, NULL);
        }
    }

Like if the above codes , if i were to say that for my temperature. I wouldnt want it to be random as you can see it uses random. I want to set a value for my temperature and decrease like a constant until it reaches 0 in my print function shown below.

    printf("Sampled temperature: %i\n", temperature);
            last_sample_time = current_time;