Tech Study

Write C Program to find maximum number using switch case

Introduction

Write C Program to find maximum number using switch case

#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

Write C Program to find maximum number using switch case
Write C Program to find maximum number using switch case

TaggedWrite C Program to find maximum number using switch case

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more