Canna

Tuesday, 25 September 2018

Substraction of numbers

  • Problem Description

    Harinis home work for second day is to subtract two numbers, help Harini to solve the problem.
  • Test Case 1

    Input (stdin)
    7.2 1.5
    
    
    Expected Output
    The Subtraction of two number is:5.700000
    
    The Subtraction of two number is:5.70
  • Test Case 2

    Input (stdin)
    5.0 2.0
    
    
    Expected Output
    The Subtraction of two number is:3.000000
    
    The Subtraction of two number is:3.00
  • Program
  • #include <stdio.h>
    int main()
    {
      float a,b,sub;
      scanf("%f%f",&a,&b);
      
      
      sub=a-b;
      printf("The Subtraction of two number is:%f\n",sub);
      printf("The Subtraction of two number is:%.2f\n",sub);
      
      
    
     return 0;
    }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.