#include
#include
//Run this to study the mathmatical usages in C.
//The big problem is division of integers
int
main ()
{
int i = 15;
int j = 7;
printf("\n Assume i=%d and j = %d \n", i, j);
printf( "i/j is %d \n", i/j);
printf( "j/i is %d \n", j/i);
printf( "(double)i/j is %f \n", (double)i/j);
printf( "(double)j/i is %f \n", (double)j/i);
printf( "53.2*22 is %f \n", 53.2*22);
printf( "53.2/22 is %f \n", 53.2/22);
//importance: if one number being divided is a float, the output is float.
//if both are integers, it assumes the output is an integer.
//what if you want to find out the remainder? That's what the modulus operator (%) is for
printf( "53 modulus 22 is %d \n", 53 % 22);
return 0;
}
/*
Local Variables:
compile-command: "gcc Exercise6.3.c -Wall -o exercise6.3 "
End:
*/