Computer Science, asked by raavideepika2307, 6 months ago

write a c program to read two integer values for the variables first_number, second_number and calculate the difference between the first_number and second_number.if the difference is in between the range -25 to 25 then double the difference and print, else print the difference as it is​

Answers

Answered by charu47Sa
1

Answer:

#include <stdio.h>

int main() {

int x, y;

float div_result;

   printf("Input two numbers: ");

printf("\nx: ");

   scanf("%d", &x);

   printf("y: ");

   scanf("%d", &y);

#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;

}

 

Similar questions