Number subtraction program like A-B=Ans.

0

Now this program is like a Number subtraction program. In this program we subtract a two integers in variables and output is our final answer.so we make a Number subtraction program and here is our code.

INPUT:

  1. #include<stdio.h>
  2. #include<conio.h>
  3. int main ( )
  4. {
  5. clrscr ( );
  6. int   a,b,ans;
  7. printf (" enter the value of a ");
  8. scanf ("%d",&a");
  9. printf (" enter the value of b ");
  10. scanf ("%d",&b");
  11. ans=a-b;
  12. printf (" ans=%d", ans);
  13. getch ( );
  14. }

OUTPUT:

  1. enter the value of a.    15
  2. enter the value of b.   10
  3. ans = 5


Post a Comment

0Comments
Post a Comment (0)