GoLang
xxxxxxxxxx
package main
import (
"fmt"
"time"
)
func main() {
i := 2
fmt.Print("Write ", i, " as ")
switch i {
case 1:
fmt.Println("one")
case 2:
fmt.Println("two")
case 3:
fmt.Println("three")
}
switch time.Now().Weekday() {
case time.Saturday, time.Sunday:
fmt.Println("It's the weekend")
default:
fmt.Println("It's a weekday")
}
t := time.Now()
switch {
case t.Hour() < 12:
fmt.Println("It's before noon")
default:
fmt.Println("It's after noon")
}
whatAmI := func(i interface{}) {
switch t := i.(type) {
case bool:
fmt.Println("I'm a bool")
case int:
fmt.Println("I'm an int")
default:
fmt.Printf("Don't know type %T\n", t)
}
}
whatAmI(true)
whatAmI(1)
whatAmI("hey")
}
Write 2 as two It's a weekday It's after noon I'm a bool I'm an int Don't know type string
Linux - anc-api-tools انسٹال کرنے کا طریقہ
Linux - curvedns انسٹال کرنے کا طریقہ
Python - چیک کریں کہ نمبر مثبت، منفی یا 0 ہے۔
Linux - zenmap انسٹال کرنے کا طریقہ
C - ایک عدد میں ہندسوں کی تعداد شمار کریں۔
C++ - لیپ سال چیک کریں۔
JavaScript - چیک کریں کہ آیا کوئی سٹرنگ شروع ہوتا ہے اور کچھ حروف کے ساتھ ختم ہوتا ہے۔
C++ - چیک کریں کہ نمبر پرائم ہے یا نہیں۔
C - ڈائنامک میموری ایلوکیشن کا استعمال کرتے ہوئے سب سے بڑی تعداد تلاش کریں۔
Linux - xbitmaps انسٹال کرنے کا طریقہ
Kotlin - ایک عدد کو n اعشاریہ جگہوں تک گول کریں۔
Kotlin - ایک نمبر کو ریورس کریں۔
Linux - zstd انسٹال کرنے کا طریقہ
Linux - zfs-test انسٹال کرنے کا طریقہ
Java - ایک نمبر کو ریورس کریں۔
Kotlin - کسی نمبر کا فیکٹریل تلاش کریں۔
Linux - zita-ajbridge انسٹال کرنے کا طریقہ
Kotlin - قدرتی نمبروں کے مجموعہ کا حساب لگائیں۔
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month