Professional Documents
Culture Documents
Lab Exam
What is the difference between while and do while loop. (0.5 marks)
In while loop condition comes at the beginning of the loop
In while loop there is not semi colon at the end.
While loop do not executes if the condition is false.
Do while Loop:
In do while loop condition comes at the end.
In do while loop there needs to be the semi colon.
Do while executes the body once condition is false
3)Write a code of factorial using loops. (1.5 marks)
5) Write a function which finds middle number in an array of any size. (2 marks)
MCQS:
1) a
2) c
3) c
4) a
5)c