-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.cs
More file actions
25 lines (22 loc) · 750 Bytes
/
Functions.cs
File metadata and controls
25 lines (22 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace MyVSCodeProject{
class Functions{
public static double CalculerPerimetreCarre(double cote)
{
double perimetre = cote * 4;
return perimetre;
}
public static double CalculerPerimetreCercle(double rayon)
{
const double pi = 3.14159;
double circonference = (2 * rayon) * pi;
return circonference;
}
public static void AfficherLesPerimetres()
{
double perimetreCarre = CalculerPerimetreCarre(6);
double perimetreCercle = CalculerPerimetreCercle(6);
Console.WriteLine("Le périmètre du carré est de " + perimetreCarre);
Console.WriteLine("Le périmètre du cercle est de " + perimetreCercle);
}
}
}