Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Exercice de Conversion de Types | Gestion des Types de Données
Bases de C#

bookExercice de Conversion de Types

Store the value number in the variables n1 and n2. Use explicit type casting if needed.

main.cs

main.cs

copy
1234567891011121314151617181920
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { float number = 14.47f; // Change code below this line long n1 = ___; double n2 = ___; // Change code above this line Console.WriteLine(n1); Console.WriteLine(n2); } } }

Use type casting only on the long variable.

main.cs

main.cs

copy
1234567891011121314151617181920
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { float number = 14.47f; // Change code below this line long n1 = (long) number; double n2 = number; // Change code above this line Console.WriteLine(n1); Console.WriteLine(n2); } } }

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 12

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

bookExercice de Conversion de Types

Glissez pour afficher le menu

Store the value number in the variables n1 and n2. Use explicit type casting if needed.

main.cs

main.cs

copy
1234567891011121314151617181920
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { float number = 14.47f; // Change code below this line long n1 = ___; double n2 = ___; // Change code above this line Console.WriteLine(n1); Console.WriteLine(n2); } } }

Use type casting only on the long variable.

main.cs

main.cs

copy
1234567891011121314151617181920
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { float number = 14.47f; // Change code below this line long n1 = (long) number; double n2 = number; // Change code above this line Console.WriteLine(n1); Console.WriteLine(n2); } } }

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 12
some-alt