Thursday, July 11, 2024

Difference of Two Numbers in C

 



Program Listing

#include <stdio.h>


int main()

{   

    int a=0,b=0,difference=0;

    printf("\n\n");

printf("\tDifference of Two Numbers in C");

printf("\n\n");

printf("\tGive Two Numbers : ");

    scanf("%d%d",&a,&b);


    /* Compute the Difference of Two Numbers */

    

    difference = (a - b);

    

printf("\n\n");

printf("\t===== DISPLAY RESULTS =====");

printf("\n\n");

printf("\tThe difference between %d and %d is %d.",a,b,difference);

printf("\n\n");

printf("\tEnd of Program");

printf("\n");

}


No comments:

Post a Comment