Sunday, April 19, 2020

Greatest of Two Numbers in 'C'

Source Code For Greatest of Two Numbers:

#include<stdio.h>
#include<conio.h>
void main()
{
            int a, b;
            printf("enter two numbers");
            scanf("%d%d",&a,&b);
            if(a>b)
            {
                     printf("the number %d is greater",a);
             }
             else if(a<b)
             {
                       printf("the number %d is greater",b);
              }
              else
              {
                      printf("the numbers are equal");
               }
               getch();
       

 }


Output:





No comments:

Post a Comment