当前位置:网站首页>Real variable instance

Real variable instance

2022-06-25 14:46:00 m0_ fifty-nine million nine hundred and forty-nine thousand fou

1、1.0/3*3 How much ?

#include <stdio.h>

void main()
{
	float a, b, c,d;
	a = 1.0;
	b = 3;
	c = 3;
	d = a / b * c;
	printf("a / b * c=%f\n", d);
}

Execution results :a / b * c=1.000000

2、3/2= How many? ?

#include <stdio.h>

void main()
{
	float a, b, c;
	a = 3;
	b = 2;
	c = a / b;
	printf("a / b =%f\n", c);
}

Execution results :a / b =1.500000

3、1/3*3 How much ?

#include <stdio.h>

void main()
{
	float a, b, c, d;
	a = 1;
	b = 3;
	c = 3;
	d = a / b * c;
	printf("a / b * c=%f\n", d);
}

Execution results :a / b * c=1.000000

原网站

版权声明
本文为[m0_ fifty-nine million nine hundred and forty-nine thousand fou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200521145191.html