Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RemusDBD authored Sep 2, 2024
1 parent def5ad5 commit 2fff968
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>

int main()
{
int slices = 17;
int people = 2;
/*2 ways to fix this:
1) add .0 to a constant
2) explict type casting*/

double halfThePizza = (double) (slices / people) ; // (double) -> unary

printf("%f\n", halfThePizza);

double c = 25/2 * 2 ;
double d = 25/2 * 2.0;

printf("c: %f\n", c);
printf("d: %f\n", d);

return 0;
}

0 comments on commit 2fff968

Please sign in to comment.