예제 #1
0
int main(int argc, char* argv[])
{
	double number;

	printf("Enter a numer: ");
	scanf("%lf", &number);
	printf("Nearest Integer: %f\n", roundToInteger(number));
	printf("Nearest Tenths: %f\n", roundToTenths(number));
	printf("Nearest Hundreths: %f\n", roundToHundreths(number));
	printf("Nearest Thousandths: %f\n", roundToThousandths(number));

	return 0;
}
예제 #2
0
파일: ex05_11.c 프로젝트: WACodeAcademy/C
int main (void) {

	float x;

	// Ask the user to enter a number
	printf("%s", "Enter a number: ");
	scanf("%f", &x); 

	// Calculate the values
	roundToInteger(x);
	roundToTenths(x);
	roundToHundredths(x);
	roundToThousandths(x); 

	puts(""); 
} // end main