Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
//var a:Int=5
//if a>8{
// print("value of a is \(a)")
///} else if a<7 {
// print("value of a is less than 7")
//}
//var b:Int=11
//switch b%2 {
// case 10
// print("value of b is 10")
// fallthrough
// case 5:
// print("value of b is 11")
// case 0:
// print("value is 0")
//default:
//print("defualt case")
//}
//var a:Int=7
//var b:Int=8
//var max=a>b?a:b
//var a:[Int]=[10, 20, 30]
//for i in a {
// print("value of i is \(i)")
//}
//var index=5
//repeat{
// print("valx=index+1
//}while inue of index is \(index)")
/// indedex<10
//var index=10
//repeat{
//index=index+1
//if index==15
//{
//break
//}
//print("value of index is \(index)")
//} while index<20
var a=String("hello")
a=a+"hi"
print(a)
if a.isEmpty{
print("string is empty")
} else{
print("string has characters")
}
print(a)
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more