Senin, Juni 23, 2014

Program C Division of Two Numbers Use float Variable

Example of the simplest program in using float variable on C programming language is program of divison of two numbers, because division result usually is not integer, example as follows:

main()
{
  float num1,num2;
  printf("input first number! ");
  scanf("%g", &num1);
  printf("input second number! ");
  scanf("%g", &num2);
  printf("%g : %g = %g", num1, num2, num1/num2);
  getch();
}

0 komentar: