Skip to content

Conversation

@anonfedora
Copy link
Contributor

Add Functions for Arithmetic Operations, String Manipulation, and Even Check

Description

This PR introduces the following features to enhance the functionality of the application:

  1. Check if the Sum of Two Integers is Even

    • Added is_even(x: i32, y: i32) function to determine if the sum of two integers is even.
    • Supports additional utility function sum_even(x: i32, y: i32) to calculate the sum of two integers.
  2. Floating-Point Arithmetic Operations

    • Addition: sum(x: f32, y: f32)
    • Subtraction: subtract(x: f32, y: f32)
    • Division: divide(x: f32, y: f32)
    • Multiplication: multiply(x: f32, y: f32)
    • Modulo: modulo(x: f32, y: f32)
  3. String Concatenation

    • Added say_name(first_name: &str, surname: &str) function to concatenate and display full names in a formatted message.

Sample Outputs

  • Even Check

    • Input: (5, 5) → Output: Is Even? false. The sum of the numbers, 5 and 5.
    • Input: (22, 21) → Output: Is Even? false. The sum of the numbers, 22 and 21.
  • Arithmetic Operations
    Example:

    The sum is 15.04
    The subtraction is 5.20
    The division is 1.44
    The multiplication is 159.81
    The modulo is 5.10
    
  • String Concatenation

    • Input: ("Eleazar", "Anonefdora") → Output: Hello, Eleazar Anonefdora

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant