Review On Data Types
Review On Data Types
In programming, whenever we use a variable we must What is the difference between these two?
declare it first in order to make use of them
Double float is just float with larger memory.
#include<stdio.h>
Let’s try running this code:
main ()
#include<stdio.h>
{ main (void)
int x; {
} float x;
a = x / y + z;
printf(“The value of x is: %i”, x); Assume the inputs x = 1.5, y = 2.3, and z = 1.6.
} Using a calculator, the value assigned to variable a
would be 2.252.
(Type out the code in your compilers, do not copy +
paste.) However when we implement this code, the actual
value of variable a will be 2.1. This is because of the
Try running this code and then enter numerical inputs.
declared data types of the variables. I hope this is clear
Your output will be the same as your input as long as it
to you guys since we will encounter more math
is a whole number numerical value.
problems as we go on. Thanks.