Professional Documents
Culture Documents
Mid Term Exam (Lab)
Mid Term Exam (Lab)
(Lab)
Questions
1. Write a Dart function named calculateSum that takes two integers
as input and returns their sum.
2. Complete the following Dart code to print the numbers from 1 to 10
using a loop:
void main() {
for (int i = 1; i <= 10; i++) {
print(i);
// Write your code here
}
}
void main() {
int num = 7;
bool result = isOdd(num);
This document is the intellectual property of Hazza Institute of Technology, Lahore that can only be
used for particular training purposes. This material may not be quoted, photocopied, reproduced in
any form without the prior written consent of Hazza Institute of Technology.
print(result);
}
This document is the intellectual property of Hazza Institute of Technology, Lahore that can only be
used for particular training purposes. This material may not be quoted, photocopied, reproduced in
any form without the prior written consent of Hazza Institute of Technology.