In this lab, you will learn how to use the if-else double-selection statement.
Perform the following tasks in the C# block:
if condition to check if the marks obtained are greater than 89 and less than 101, then return the variable grd as A.else if condition to check if the marks obtained are greater than 59 and less than 90, then return the variable grd as B.else condition to return the variable grd as C, if marks obtained are less than 59.return keyword.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
93
Sample output:
A
QUESTION 2
In this lab, you will learn how to use the switch multiple-selection statement.
Complete the given code in the C# block by performing the following tasks:
break statement.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
8
8
*
Sample output:
64
QUESTION 3
In this lab, you will learn how to use the while loop.
Complete the given code in the C# block by performing the following tasks:
while loop with the test condition as n > 0.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
12
Sample output:
78
QUESTION 4
In this lab, you will learn how to use the do-while loop.
Complete the given code in the C# block by performing the following tasks:
do-while loop to store the product of the variables i and result in the variable result within the loop.do-while loop in such a way that the loop executes till the value of the variable i becomes greater than a.return keyword.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
5
Sample output:
120
QUESTION 5
In this lab, you will learn how to use the for loop.
Complete the given code in the C# block by performing the following tasks:
for loop with an initial value of the variable i as 1, test condition as i <= a, and increment value of the variable i by 1.return keyword.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
5
Sample output:
120
QUESTION 6
In this lab, you will learn how to use the for loop.
Complete the given code in the C# block by performing the following tasks:
if condition to check whether (a==1) returns false or (a==2) returns true.for loop with the variable i whose initial value is 2 and execute the loop until the value of the variable i becomes less than or equal to a/2.if condition to check whether the variable a returns 0 when it is divided by i.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
97
Sample output:
True
QUESTION 7
In this lab, you will learn the concept of functions and work with them.
Complete the given code in the C# block by performing the following tasks:
Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
10
20
30
40
50
Sample output:
30
QUESTION 8
In this lab, you will learn the concept of functions and work with them.
Complete the given code in the C# block by performing the following tasks:
void keyword with the name Add and two integer parameters as x and y.Console.WriteLine() to display the value of the variable sum.Note: In the C# block, replace the comments with the appropriate code, if required.
Sample input:
10
20
Sample output:
30
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more