1.

Write a program to subtract two numbers.​

Answer»

Algorithm to subtract TWO numbers in C:1) Start2) Accept NUMBER one3) Accept Number TWO4) Subtract both the numbers5) Print the result.6) EndProgram to subtract two numbers in C:C/C++27 lines/*Program to subtract two numbers in C.Programmer: Harsh Shah, Date: 29/6/13*/#include#includevoid main(){int one, two, sub;printf("Enter first number - ");scanf("%d",&one);printf("Enter second number - ");scanf("%d",&two);sub = one - two;printf("The SUBTRACTION of numbers %d and %d is %d",one,two,sub);getch();}//End of the program.Output:Enter first number – 22Enter second number – 11The subtraction of numbers 22 and 11 is 11So this was, the program to subtract two numbers in C.



Discussion

No Comment Found