LoginSignup
0
0

More than 5 years have passed since last update.

Swiftが得意なみなさんに、息抜き用のクイズです

Posted at

下記コードの実行結果はどうなるでしょうか?

その1

func hello() {
    return
    print("hello")
    print("hello")
    print("hello")
    print("hello")
}
hello()
  1. hello と1行出力される
  2. hello が3行出力される
  3. hello が4行出力される
  4. コンパイルエラー
  5. 何も表示されない

その2

func hello() {
    return;
    print("hello")
}
hello()
  1. hello と出力される
  2. コンパイルエラー
  3. 何も表示されない

以上、お楽しみください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0