Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem visual studio code
Message
 
 
À
15/03/2022 15:59:39
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01683863
Message ID:
01683872
Vues:
32
>>
>>I changed the name of the Tester to Main but I get the same error.
>>
>>What am I missing?
>
>Try this:
>PS - l lied about my age.
>
>
>
>using System;
>using System.Collections.Generic;
>using System.Linq;
>using System.Text;
>
>namespace ConsoleApplication1
>{
>    class Program
>    {
>        static void Main(string[] args)
>        {
>            Tester tester = new Tester();
>            tester.test();
>        }
>
>    }
>    class Tester
>    {
>        public void test()
>        {
>            Console.WriteLine("Veuillez saisir votre prénom.");
>            string prenom = Console.ReadLine();
>            Console.WriteLine("Veuillez saisir votre age.");
>            string age = Console.ReadLine();
>            Console.WriteLine("Bonjour " + prenom + ", vous avez " + age + " ans.");
>        }
>    }
>}
>
This code works; no error. But for some reason, the command window only shows the first line of your code:
"Veuillez saisir votre prénom."
Two other lines are not showing.
Do I still miss something?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform