Bonjour,
Je suis débutant en C#
J'ai un problème avec mon code.
Le programme s'arrête avant d'arriver à la fonction Start()
C'est une ébauche :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
using System;
 
namespace Tableaux
{
	class Program
	{
		public static void Main(string[] args)
		{
			Tableau MyTab = new Tableau();
			Console.Write("Entrez un nombre inférieur à 100 000 : ");
			string choix = Console.ReadLine();
			int nombre = Int32.Parse(choix);
			int resultat = MyTab.Start(nombre);
			Console.WriteLine(resultat);
		}
	}
	class Tableau
	{
		int i = 0;
		int[] monTableau = new int[1000];
		private int MonTableau
		{
			get
			{
				return monTableau[i];
			}
		}
		public int Start(int nombre)
		{
			int mod = 2;
			int resultat = nombre%mod;
			return resultat;
		}
	}
}