Write C Program to find maximum number using switch case


Introduction

Write C Program to find maximum number using switch case


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>

int main()
{
    int num1, num2;

    //Reading two numbers from user
    printf("Enter two numbers to find maximum number: ");
    scanf("%d%d", &num1, &num2);

    //Condition to check maximum number
    switch(num1 > num2)
    {
        case 0: printf("%d is Maximum number", num2);
            break;

        case 1: printf("%d is Maximum number", num1);
            break;
    }

    return 0;
}

Result

C language

     





Related Topics




Popular Posts