From 561ccc7b66081c790aa01126eb0e2147c80f6a1b Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Thu, 23 Jan 2020 01:40:28 -0500 Subject: [PATCH] Implement "Problem 4" --- main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 20ee868..eafafb5 100644 --- a/main.c +++ b/main.c @@ -105,14 +105,21 @@ void problem_3() { /** * Problem 4 * - * + * Declare a double of "9999999.3399999999". + * Print to console. + * Cast to float and print again. */ void problem_4() { printf("\n\nProblem 4 start.\n\n"); printf("Expected Output:\n"); - printf("\n"); + printf("9999999.3399999999\n"); printf("Actual Output:\n"); + double test_double = 9999999.3399999999; + printf("%.10f\n", test_double); + float test_float = (float) test_double; + printf("%.10lf\n", test_float); + printf("\nProblem 4 end.\n"); } -- GitLab