Created
May 31, 2025 18:09
-
-
Save alexeisperanski/d70569bea9b9408908632f524af40eee to your computer and use it in GitHub Desktop.
NumberOfMultiplies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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