Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C# programming exercise 2
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("What is the correct way to declare a variable to store an integer value in C#?"); Console.WriteLine("a. int 1x=10"); Console.WriteLine("b. int x=10"); Console.WriteLine("c. float x=10"); Console.WriteLine("d. string x=\"10\""); char not; Console.WriteLine("Chose the correct letter"); not = (char) Console.Read(); switch(not) { case'a': Console.WriteLine("Wrong answer"); break; case'b': Console.WriteLine("Correct answer"); break; case'c': Console.WriteLine("Wrong answer"); break; case'd': Console.WriteLine("Wrong answer"); break; default: Console.WriteLine("Invalid answer"); break; } } } }
run
|
edit
|
history
|
help
0
rathit
d
ICollection<T>.Add(T) - Performance Test
string test
Better Random number blocks
2 3
asdfrgthyjuhtgrfed
Recur6
HTML Hex to RGB without using System.Drawing C#
asxasx sxa