Skip to content
Snippets Groups Projects
Commit 561ccc7b authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Implement "Problem 4"

parent c9ccbd4d
Branches
No related merge requests found
...@@ -105,14 +105,21 @@ void problem_3() { ...@@ -105,14 +105,21 @@ void problem_3() {
/** /**
* Problem 4 * Problem 4
* *
* * Declare a double of "9999999.3399999999".
* Print to console.
* Cast to float and print again.
*/ */
void problem_4() { void problem_4() {
printf("\n\nProblem 4 start.\n\n"); printf("\n\nProblem 4 start.\n\n");
printf("Expected Output:\n"); printf("Expected Output:\n");
printf("\n"); printf("9999999.3399999999\n");
printf("Actual Output:\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"); printf("\nProblem 4 end.\n");
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment