Saturday, August 25, 2018

WIND CHILL

  • Problem Description

    When the wind blows in cold weather, the air feels even colder than it actually is because the movement of the air increases the rate of cooling for warm objects, like people. This effect is known as wind chill.

    In 2016, Jammu and Kashmir, the Delhi and the Himachal Pradesh adopted the following formula for computing the wind chill index. Within the formula Ta is the air temperature in degrees Celsius and V is the wind speed in kilometers per hour.

    A similar formula with different constant values can be used with temperatures in degrees Fahrenheit and wind speeds in miles per hour.
    WCI = 13.12 + 0.6215Ta - 11.37V power 0.16 + 0.3965Ta V power 0.16

    Write a program that begins by reading the air temperature and wind speed from then user. Once these values have been read your program should display the wind chill index rounded to the closest integer. The
  • CODING ARENA
  • #include <stdio.h>
    #include <math.h>
    int main()
    {
      float a,b,p,wcl;
      scanf("%f %f",&a,&b);
      p=pow(b,0.16);
      wcl=13.12+(0.6215*a)-(11.37*p)+(0.3965*a*p);
      printf("Windchill is %.2f",wcl);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    39.2
    
    61.1
    
    
    Expected Output
    Windchill is 45.54
  • Test Case 2

    Input (stdin)
    0
    
    
    Expected Output
    0

No comments:

Post a Comment