#include<stdio.h>
int main(){
int integer; /* an integer */
float floating; /* a floating-point number */
floating = 1.0 / 2.0; /* "floating" 0.5 */
printf("%f\n",floating);
integer = 1 / 3; /* integer 0 */
printf("%d\n",integer);
floating = (1 / 2) + (1 / 2); /* floating 0.0 */
printf("%f\n",floating);
floating = 3.0 / 2.0; /* floating 1.5 */
printf("%f\n",floating);
integer = floating; /* integer 1 */
return (0);
}
|