#include stdio.hint main(void) /* print i and i/2 with fractions */{int i;for (i = 1; i = 50; ++i)
编程学习网为您整理以下代码实例,主要实现:将一种数据类型转换为另一种类型,希望可以帮到各位朋友。
#include <stdio.h>
int main(voID) /* print i and i/2 with fractions */
{
int i;
for (i = 1; i <= 50; ++i)
printf("%d / 2 is: %f\n", i, (float)i / 2);
return 0;
}