Saturday 30 November 2019

C program to find maximum between three numbers

------------------------------------------------------------------

#include <stdio.h>

int main()
{
    int num1, num2, num3, max;

    printf("Enter three numbers: ");
    scanf("%d%d%d", &num1, &num2, &num3);


    if(num1 > num2)
    {
        if(num1 > num3)
        {
            max = num1;
        }
        else
        {
            max = num3;
        }
    }
    else
    {
        if(num2 > num3)
        {
            max = num2;
        }
        else
        {
            max = num3;
        }
    }

    printf("Maximum among all three numbers = %d", max);

    return 0;
}

----------------------------------------------------------------------------- 

check whether a number is positive, negative or zero


Friday 29 November 2019

find maximum between two numbers

 The Wall Known Mathed

#include <stdio.h>

int main()
{
    int num1, num2;

    printf("Enter two numbers: ");
    scanf("%d%d", &num1, &num2);

    if(num1 > num2)
    {
        printf("%d is maximum", num1);        
    }

    if(num2 > num1)
    {
        printf("%d is maximum", num2);
    }

    if(num1 == num2)
    {
        printf("Both are equal");
    }

    return 0;
--------------------------------------------------------------------------------
 

 The Esiest Known Mathed

#include <stdio.h>

int main()
{

     int num1,num2;
 
     printf("Enter The two number: "); 
     scanf("%d%d", &num1, &num2);
 
     if(num1 > num2)
     {
          printf("%d is maximum", num1);
 
     }
 


     else if(num1 < num2)
     {
           printf("%d is maximum", num2);
 
     else
     {
           printf("Both are equal");
     }

           return 0;

}
 

three number