saving . . . saved Difference between two numbers has been deleted. Difference between two numbers has been hidden .
Difference between two numbers
Title
Question
#include <stdio.h>
int main()
{
      int a,b;
      int diff;
      printf("Enter first number: ");
      scanf("%d",&a);
      printf("Enter second number: ");
      scanf("%d",&b);
      if( a>b) 
      diff=a-b;
      else
      diff=b-a;
      printf("\nDifference between %d and %d
             is = %d", a,b,diff);
      return 0;
}


By 
M. Bala priyadharshini 
ECE department 
IRTT

C-and-Cpp Scope-Of-Variables 04-05 min 50-60 sec 06-12-21, 10:17 p.m. mpandiselvan2021@gmail

Answers:

Assignments are only for self-assessment. If you have any specific question related to this tutorial please post here.
10-01-22, 2:26 p.m. hbammkanti



#include <stdio.h>
int main()
{
      int a,b;
      int diff;
      printf("Enter first number: ");
      scanf("%d",&a);
      printf("Enter second number: ");
      scanf("%d",&b);
      if( a>b) 
      diff=a-b;
      else
      diff=b-a;
      printf("\nDifference between %d and %d  is = %d", a,b,diff);
      return 0;
}
12-08-24, 2:36 p.m. tanmayi.P


#include <stdio.h>
int main()
{
      int a,b;
      int diff;
      printf("Enter first number: ");
      scanf("%d",&a);
      printf("Enter second number: ");
      scanf("%d",&b);
      if( a>b) 
      diff=a-b;
      else
      diff=b-a;
      printf("\nDifference between %d and %d  is = %d", a,b,diff);
      return 0;
}
16-08-24, 4:41 p.m. 238T1A05F5


#include <stdio.h>
int main()
{
      int a,b;
      int diff;
      printf("Enter first number: ");
      scanf("%d",&a);
      printf("Enter second number: ");
      scanf("%d",&b);
      if( a>b) 
      diff=a-b;
      else
      diff=b-a;
      printf("\nDifference between %d and %d  is = %d", a,b,diff);
      return 0;
}
19-08-24, 2:44 p.m. nasreensk2005@gmail.com


Log-in to answer to this question.