Font size
WorksheetsSD_Semi-Final Quiz
Total questions: 25
Worksheet time: 25mins
What is a correct syntax to output "Hello World" in C#?
C# is an alias of C++
True
False
The most common method to output something in C# is ....................
WriteLine()
cout
cin
How do you insert COMMENTS in C# code?
# This is a comment
// this a comment
/* This ia a comment
The types of Variables who stores floating point numbers is ..............
int
char
double
bool
Which data type is used to create a variable that should store text?
String
Int
Double
Char
How do you create a variable with the numeric value 5?
num x = 5;
int x = 5;
x = 5;
double x = 5;
How do you create a variable with the floating number 2.8?
int x = 2.8;
int x = 2.8D;
byte x = 2.8;
double x = 2.8D;
The character must be surrounded by ......................
single quotes
Double quotes
Angle brackets
Square brackets
How do you write a Variable in C-Sharp?
var myVariable = 10
var myVariable = 10;
int myVariable = 10;
local myVariable = 10
How to make Functions in C-Sharp?
function myFunction(){
//code here
}
function myFunction()
--code here
end
void myFunction(){
//code here
}
def myFunction(): #code here
Which of the following are Assignment operators in C#?
1, 2, 3
1, 3, 4
2, 4, 5
3, 4, 5
It allows to specify the code that should run, if the condition in the first if statement evaluates to false.
if statement
if else statement
if else if else statement
switch statement
It allows use to execute code based on a predefined set choices.
if statement
if else statement
if else if else statement
switch statement
It terminates the case in the switch statement where it is placed.
end
go to
break
continue
It can be used to terminate a case in the switch statement.
condition statement
increment statement
break statement
continue statement
Used to write a single line comments in a C# program
/*
C:
//
{}
The Console.ReadLine() method is used to
Write information to the screen/console
Read information input from the user
Reading lines from a file
Making a space between text
The Console.WriteLine() method is used to
Store information in a variable
Read text input from the user
Print text to the console
Write lines on the screen to separate sections of coding
Math operators like
÷ + − × There is one more specificly used in coding to get the REMAINDER+=
&
%
@
thing = thing + 1; can ALSO be expressed
thing + thing = thing2;
thing+=1;
thing++;
thing(thing);
To change
string thing = "holiday break";
to read "HOLIDAY BREAK"
make it uppercase man
thing = .ToUpper()
thing.ToUpper();
thing "toUpper()";
The process of appending one string to the end of another string. Example: string sentence = ("This" + class + "is my favorite");
plus sequence
put together
concatenation
meow
To change
string thing = "HOLIDAY BREAK";
to read "holiday break"
make it lowercase man
thing = .ToLower()
thing.ToLower();
thing "toTower()";
Which of the following are NOT Relational operators in C#?
1, 3
2, 4
3, 5
4, 5
