+ 2

How to get a user input in swift?

Accepting numbers by user

15th Sep 2019, 3:10 AM
Yash chitroda
Yash chitroda - avatar
4 ответов
+ 1
let s = readLine() var n = Int(s!)
15th Sep 2019, 4:10 AM
unChabon
unChabon - avatar
+ 1
Can u give me an example of adding 2 number with accepting user input
15th Sep 2019, 4:27 AM
Yash chitroda
Yash chitroda - avatar
0
let s = readLine() var n = Int(s!) print(n! + 5) This adds 5 to a number... Your turn :)
15th Sep 2019, 4:36 AM
unChabon
unChabon - avatar
0
Var a = 10 Var b = 20 Let c = a+b Print(c) Sameee program but i wanna 2 input from user!? How can we do that
15th Sep 2019, 7:56 AM
Yash chitroda
Yash chitroda - avatar