All pastes #474053 Raw Edit

Miscellany

public c v1 · immutable
·published 2007-05-06 16:11 UTC
rendered paste body
#include <stdio.h>int main(void){	int choice = 0;	float temperature = 0.0f;	printf("1. Convert a temperature from degrees Celsius to degrees Fahrenheit.\n"           "2. Convert a temperature from degrees Fahrenheit to degrees Celsius.\n"           "\nPlease choose one of the available options:");	scanf("%d", &choice);	switch(choice)	{		case 1:            printf("Enter a temperature in deegres Celsius:");            scanf("%f", &temperature);            printf("The temperature in degrees Fahrenheit is: %.2f",                   (temperature * 1.8f) + 32.0f); 			break;				case 2:		    printf("Enter a temperature in deegres Fahrenheit:");		    scanf("%f", &temperature);		    printf("The temperature in degrees Celsius is: %.2f",                   ((temperature - 32.0f) * 5.0f) / 9.0f);			break;				default:		    printf("\nInvalid choice!\n\a");			break;	}	return 0;}