Solved programming problem

Compare Two Number in C

Source code

#include<stdio.h>

int main()

{

    int n,m;

    printf("Please Enter two number: ");

    scanf("%d %d",&n,&m);

    if(n>m)

    {

        printf("
%d is Greater Then %d.
",n,m);

    }

    else if(n<m)

    {

      printf("
%d is Smaller Then %d.
",n,m);

    }

    else if(n==m)

    {

        printf("
%d and %d are Equal.
",n,m);

    }

    return 0;

}

Output

Please Enter two number:5 -10

5 is Greater ThenĀ  -10

Join the discussion

Add your comment