C Saved Program: calm-palace

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


     #include<stdio.h>
     
     int main()
     {
         int temp[5];
         int i,sum = 0,k=0;
         
         printf("Enter the temperature in Kelvin:\n");
         for(i=0; i<5; i++)
        {
            scanf("%d", &temp[i]);
        }
        
        for(i=0; i<5; i++)
        {
            if(temp[i]>0)
            {
            sum = sum + temp[i];
            }
        }
        if(sum>0)
        {
        printf("The Metal is totally heated for %d Kelvin", sum);
        }
        else
        {
            printf("The Metal is not yet heated.");
        }
        
    }
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs