/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program that determine if the first is
evenly divisible by the second, and then display an appropriate
message at the terminal
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
    */
#include <stdio.h>

int main() {
    int num1_EU, num2_EU;

    // Get user input for the two numbers
    printf("Enter the first integer: \n");
    scanf("%d", &num1_EU);

    printf("Enter the second integer: \n");
    scanf("%d", &num2_EU);

    // Check if the second number is 0
    if (num2_EU == 0) {
        printf("Cannot divide by zero. Please enter a non-zero second integer.\n");
    } else {
        // Check if the first number is evenly divisible by the second
        if (num1_EU % num2_EU == 0) {
            printf("%d is evenly divisible by %d.\n", num1_EU, num2_EU);
        } else {
            printf("%d is not evenly divisible by %d.\n", num1_EU, num2_EU);
        }
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: