Get decimal from console : Console Read Decimal « Console « C / ANSI-C






Get decimal from console

Get decimal from console

#include <stdio.h>

int main(void)
{
  int i, j;

  printf("Enter a decimal number: ");
  scanf("%d.%d", &i, &j);
  printf("left part: %d, right part: %d", i, j);

  return 0;
}
           
       








Related examples in the same category