Responsive Advertisement
Subtract two numbers in C (with algorithm) - ReadMeNow


* Write a Program and Algorithm to find the Subtract of two Number by using C Program.

Algorithm :

  1. Start
  2. Read the value of num1 ,num2 and Sub.
  3. Enter the value of num1.
  4. Enter  the value of num2.
  5. Calculation, Sum=num1+num2;
  6. Print the value of addition of two number "Sub".
  7. Stop.

Program  :

#include<stdio.h>
#include<conio.h>
void main()
{
 int num1,num2,Sub;
clrscr();
printf( "Enter the value of number 1 and number 2" );
scanf("%d%d",&num1,&num2);
Sub=num1-num2;
printf( " Subtract of two number :: ",Sub);
getch();
}

              output
 Enter the value of number 1 and number 2 = 10 ↲
2 ↲
Sum of two number :: 8


Thanks for visit this page and Support me.

No comments:

Post a Comment

Pages