Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zadatak2Pokušaj2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.Write("Upisite prvi broj: ");
  14. int broj1 = int.Parse(Console.ReadLine());
  15. Console.Write("Upisite drugi broj: ");
  16. int broj2 = int.Parse(Console.ReadLine());
  17. int djelitelj = 0;
  18. for(int i = 2; i <= broj1*broj2; i++)
  19. {
  20. if(i % broj1 == 0 && i % broj2 == 0)
  21. {
  22. djelitelj = i;
  23. break;
  24. }
  25.  
  26. }
  27. Console.WriteLine("Djelitelj = {0}", djelitelj);
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement