[ create a new paste ] login | about

Link: http://codepad.org/wY11qOSB    [ raw code | output | fork ]

C, pasted on Oct 1:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>

int main()
{
	double d;
	int i;

	scanf("%lf", &d);
	i = d * 10;
	printf("10倍した数の整数部=%d\n", i);
	i = i % 10;
	printf("10倍した数の一の位=%d\n", i);
	return 0;
}


Output:
1
2
10倍した数の整数部=0
10倍した数の一の位=0


Create a new paste based on this one


Comments: