Pages

Saturday, November 30, 2013

Write a program that subtract two floating point numbers and shows their sum on the screen in C

Source Code:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include <stdio.h>
#include <conio.h>
void main (void)
{
   Float Num1, Num2, Sub;
   Num1 = 8;
   Num2 = 5;
   Sub = Num1 - Num2;
   printf("%2.2f + %2.2f  = %2.2f ", Num1, Num2, Sub);
   getch ();
      }// main

  Result:


65.77  24.27 = 41.5

No comments:

Post a Comment