[ create a new paste ] login | about

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

C, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
#include<stdio.h>
int main(void) {
  double a;
  int n;
  printf("input real number: ");
  scanf("%lf",&a);
  n = (int)(10.0 * a);
  printf("%d\n", n % 10);
  return 0;
}
/* end */


Output:
1
input real number: 0


Create a new paste based on this one


Comments: