Challenge: Declaring Explicitly Typed Variables
Declare a variable called
bigValue
of type unsigned long. Initiate it with a value of123456789
.Declare a variable called
smallValue
of type integer. Initiate it with a value of1234
.
main
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System.Drawing;
using System;
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Replace ___ with necessary data type
___ bigValue = 123456789;
___ smallValue = 1234;
Console.WriteLine(bigValue);
Console.WriteLine(smallValue);
}
}
}
12345678910111213141516171819using System.Drawing; using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Replace ___ with necessary data type ___ bigValue = 123456789; ___ smallValue = 1234; Console.WriteLine(bigValue); Console.WriteLine(smallValue); } } }
The keyword for unsigned long data type is
ulong
.
main
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
// Replace ___ with necessary data type
ulong bigValue = 1234567;
int smallValue = 1234;
Console.WriteLine(bigValue);
Console.WriteLine(smallValue);
}
}
}
123456789101112131415161718using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Replace ___ with necessary data type ulong bigValue = 1234567; int smallValue = 1234; Console.WriteLine(bigValue); Console.WriteLine(smallValue); } } }
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 2
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat