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("\n Difference between %d and %d is=%d",a,b,diff);
     return 0;
}
C-and-Cpp Scope-Of-Variables 02-03 min 0-10 sec
Answers:
Assignments are only for self-assessment. If you have any specific question related to this tutorial please post here.

Login to add comment