C - Data Types
C - Data Types
OBJECTIVES:
INTRODUCTION:
#include <stdio.h>
int main(void)
{
float fahr;
int lower, upper, step;
lower = 0;
upper = 300;
step = 20;
fahr = lower;
while (fahr <= upper) {
printf("%4.0f %6.1f\n", fahr, (5.0/9.0) * (fahr - 32.0));
fahr = fahr + step;
}
return(0);
}
NOTE:
The Fahrenheit scale is a temperature scale based on one
proposed in 1724 by physicist Daniel Gabriel Fahrenheit. It
uses the degree Fahrenheit (symbol: °F) as the unit.
The Celsius scale, previously known as the centigrade
scale, is a temperature scale used by the International
System of Units (SI). As an SI derived unit, it is used by all
countries in the world, except the U.S.
Test Data
Input a value for inch: 1000
Expected Output :
1000.0 inch is 25.4 meters
NOTE:
One inch is 0.0254 meter.
The inch is a unit of length in the (British) imperial and United
States customary systems of measurement now formally equal
to 1/36 yard but usually understood as 1/12 of a foot.
Test Data
Input an integer between 0 and 1000: 565
Expected Output :
The sum of all digits in 565 is 16
NOTE:
NOTE:
BMI: The BMI is defined as the body mass divided by the square
of the body height, and is universally expressed in units of kg/m2,
resulting from mass in kilograms and height in metres.
BMI = Weight (kg) / Height (m2)