-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
41 lines (38 loc) · 1.23 KB
/
Program.cs
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculatrice
{
class Program
{
#region private attributes
private static char operateur = '+';
private static int operande1 = 4;
private static int operande2 = 2;
private static int resultat = 0;
#endregion private attributes
/// <summary>
///
/// </summary>
/// <param name="args"></param>
private static void Main(string[] args)
{
Console.Write("Saisissez la première opérance :\n");
operande1 = int.Parse(Console.ReadLine());
Console.Write("Saisissez l'operateur :\n");
operateur = (char)Console.Read();
Console.Write("Saisissez la première opérance :\n");
operande1 = int.Parse(Console.ReadLine());
Console.Write("Le résultat du calcul " + operande1 + operateur + operande2 + " \n");
resultat = additionner(operande1, operande2);
Console.Write(resultat);
Console.ReadLine();
}
private static int additionner (int op1)
{
return op1 + op2;
}
}
}