Computer Science, asked by abhinav32aj, 1 year ago

write a c program to accept 2 numbers and find thier sum difference and product

Answers

Answered by Manya346
4

#include <stdio.h>

 

int main()

{

     

   int a,b;

   int diff;

 

   printf("Enter first number: ");

   scanf("%d",&a);

   printf("Enter second number: ");

   scanf("%d",&b);

 

   // check condition to identify which is largest number

   if( a>b )

       diff=a-b;

   else

       diff=b-a;

 

   printf("\nDifference between %d and %d is = %d",a,b,diff);

   return 0;

}


abhinav32aj: is this correct
Manya346: yes it is
Similar questions