-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolution
47 lines (37 loc) · 959 Bytes
/
solution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
1.
```
import 'dart:io';
void main() {
stdout.write("What's your name? ");
String name = stdin.readLineSync();
print("Hi, $name! What is your age?");
int age = int.parse(stdin.readLineSync());
int yearsToHunderd = 100 - age;
print("$name, You have $yearsToHunderd years to be 100");
}
2.
List<int> a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89];
for(var i in a){
if(i<5){
print(i);
}
}
3.
final int netSalary= 10000;
final int expenses= 9000;
if(netSalary<expenses){
print('You should earn more money ');
}else if(netSalary>expenses){
print('You can spend more money');
}else{
print('Your salary and expenses are same');
}
4.
final int netSalary= 10000;
final int expenses= 9000;
netsalary<expenses? print('You should earn more money '): print('You can spend more money');
5.
for(int i = 0; i <=5; i++){
print('* ' * i);
}
```