gs gs108 Data Types, Variables and Operators - Relational and Logical Operators - Quiz No.1
gs gs108 CSharp Quiz
This quiz belongs to book/course code gs gs108 CSharp of gs organization. We have 110 quizzes available related to the book/course CSharp. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Data Types, Variables and Operators. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
static void Main(string[] args) { int a = 4; int b = 5; int c = 6; int d = 8; if (((a * b / c) + d) >= ((b * c + d ) / a)) { Console.WriteLine("Line 1 - a is greater to b"); Console.WriteLine((a * b / c) + d); } else { Console.WriteLine("Line 1 - a is not greater to b"); Console.WriteLine((b * c + d )/ a); } }
"Line 1 - a is greater to b" 11
"Line 1 - a is not greater to b" 9
static void Main(string[] args) { int a = 10; int b = 5; int c = 12; int e = 8; int d; d = Convert.ToInt32((a * (c - b) / e + (b + c)) <= (e * (c + a) / (b + c) + a)); Console.WriteLine(d); if (d == 1) { Console.WriteLine("C# is great language!"); Console.WriteLine((a * (c - b) / e + (b + c))); } else { Console.WriteLine("harsh is not great language!"); Console.WriteLine((e * (c + a) / (b + c) + a)); } }
0 C# is great! 20
0 C# is not great! 25
0 C# is great! 25
0 C# is not great! 20
m = 5; int y; 1. y = m++; 2. y = ++m;
static void Main(string[] args) { int a = 8, b = 6, c = 10; int d = a * c * 2 / Convert.ToInt32(Math.Pow ((c - b), 2)); if (d == (c = Convert.ToInt32(Math.Sqrt (a * a + b * b))) && c == 10) { Console.WriteLine("figure is hypotenuse"); } else { Console.WriteLine("figure is square"); } }