Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a;
- do{
- Console.WriteLine("\nKérem az első egész számot:");
- a = int.Parse(Console.ReadLine());
- } while(a <= 0);
- int b;
- do
- {
- Console.WriteLine("\nKérem a második egész számot:");
- b = int.Parse(Console.ReadLine());
- } while (b <= 0);
- Console.WriteLine("\n7-tel osztható közöttük");
- if (b > a)
- {
- for (b--; b != a; b--)
- {
- if (b % 7 == 0)
- {
- Console.WriteLine(b);
- }
- }
- }
- else
- {
- for (a--; a != b; a--)
- {
- if (a % 7 == 0)
- {
- Console.WriteLine(a);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement