First post

Category:
Sitecore
Tags:
c#
first
By Daniel Z on 2025-11-14

Here’s my first attempt at a blog post with some random code in it.

public static double CalculateWithRandom(int first, int second, int third)
{
    // Multiply first two integers and divide by the third
    double result = (double)(first * second) / third;
    
    // Generate random whole number between 1 and 2 (inclusive)
    Random random = new Random();
    int randomNumber = random.Next(1, 3); // Next(1, 3) gives 1 or 2
    
    // Add the random number to the result
    return result + randomNumber;
}