Skip to content

Instantly share code, notes, and snippets.

@alexeisperanski
Created May 31, 2025 18:09
Show Gist options
  • Save alexeisperanski/d70569bea9b9408908632f524af40eee to your computer and use it in GitHub Desktop.
Save alexeisperanski/d70569bea9b9408908632f524af40eee to your computer and use it in GitHub Desktop.
NumberOfMultiplies
using System;
namespace IJuniorCProjects
{
internal class Program
{
static void Main(string[] args)
{
Random random = new Random();
int minValue = 10;
int maxValue = 25;
int devider = random.Next(minValue, maxValue + 1);
int minNubmer = 50;
int maxNumber = 150;
int numberOfMultiplies = 0;
for (int i = devider; i <= maxNumber; i += devider)
{
if (i >= minNubmer)
numberOfMultiplies++;
}
Console.WriteLine($"Количество чисел от {minNubmer} до {maxNumber} кратных {devider} = {numberOfMultiplies}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment