Subtraction
Subtraction
C Code:
#include <stdio.h>
int main() {
scanf("%d", &num1);
scanf("%d", &num2);
// Perform subtraction
Explanation:
o The stdio.h library is included to enable input/output functions like printf and scanf.
2. Declare Variables:
o Three integer variables (num1, num2, result) are declared to store the input
numbers and the result of the subtraction.
3. Input Numbers:
o The program prompts the user to enter two integers using printf, and scanf reads the
inputs.
4. Perform Subtraction:
o The subtraction operation num1 - num2 is performed and stored in the result
variable.
6. Return Statement:
o The return 0; at the end of the main() function signifies that the program executed
successfully.
Example Output:
Input:
Output: