K. Thermometer
Problem linkhttps://algo.codemarshal.org/contests/diu-122-fl16-termwork/problems/K
Score: 1
CPU: 1s
Memory: 512MB
CPU: 1s
Memory: 512MB
Temperature given in Fahrenheit (F) can be converted to the corresponding temperature in Celsius (C) using
the formula C = (F-32) / 9 * 5.
the formula C = (F-32) / 9 * 5.
A patient is considered to have fever if his body temperature is more than 98.4 degree Fahrenheit. Now, given a patient's temperature in Celsius, your task is to determine whether (s)he has fever or not.
Input
An integer, denoting the patient's temperature in Celsius.
Output
If the patient has fever print Fever. Print Not fever otherwise.
Samples
Input | Output |
---|---|
25 | Not fever |
Input | Output |
---|---|
40 | Fever |
Solution
#include<stdio.h> int main() { int n; double c; scanf("%d",&n); c=((98.4-32)*5)/9; if(n>c) { printf("Fever\n"); } else { printf("Not fever\n"); } return 0; }
No comments:
Post a Comment