Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MaxDeuxReel
  4. {
  5. class Program
  6. {
  7. public static void Main(string[] args)
  8. {
  9. Single distance1=0;
  10. Single distance2=0;
  11. Single PlusGrandeDistance;
  12.  
  13. Console.WriteLine("Veuillez Saisir une première distance :");
  14. distance1=Convert.ToSingle(Console.ReadLine());
  15. Console.WriteLine("Veuillez Saisir une deuxième distance :");
  16. distance2=Convert.ToSingle(Console.ReadLine());
  17.  
  18. PlusGrandeDistance=MaxDeuxReel(distance1,distance1);
  19. Console.WriteLine("La plus grande distance est :{0}",PlusGrandeDistance);
  20. Console.ReadKey();
  21. }
  22.  
  23. static Single MaxDeuxReel(Single x, Single y)
  24. {
  25. Single max;
  26. if (x>y)
  27. max=x;
  28. else
  29. max=y;
  30. return max;
  31. }
  32.  
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement