summaryrefslogtreecommitdiff
path: root/typecasting.c
blob: e508ebbb65e6aa8c4d80557b3852868a6bbc66f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>

int main(int argc, const char *argv[])
{
  int a, b;
  float c, d;

  a = 13;
  b = 5;

  c = a/b;
  d = (float)a / (float)b;
  printf("[integers]\t a = %d\t b = %d\n", a, b);
  printf("[floats]\t c = %f\t d = %f\n", c, d);
  return 0;
}