Header Ads Widget

Breaking

Search This Blog

Tuesday, October 1, 2019

C program to find subtraction of two integer number

3.Write a C program to find subtraction of two integer number

#include<stdio.h>

int main()
{
int a,b,sub;

printf("Enter the first value.: ");
scanf("%d",&a);

printf("Enter the second value.: ");
scanf("%d",&b);

sub= a-b;
printf("subtract is = %d\n", sub);

return 0;
}

Result:



#write a c program to subtract two numbers.

#include <stdio.h>

int main()
{
   int a,b,subtract;

   printf("Enter two values:\n");
   scanf("%d%d", &a, &b);

   subtract = a - b;

   printf("Difference = %d\n", subtract);

   return 0;
}

Output:




No comments:

Post a Comment