×
Create a new article
Write your page title here:
We currently have 3,187 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,187Articles

    Kleinste gemeinsame Vielfache

    <highlightSyntax>

    1. !/bin/bash
    2. Kleinste gemeinsame Vielfache von zwei Integern berechnen

    count=1 remainder=1

    read -p "Zahl1: " a read -p "Zahl2: " b

    echo "Zahl1: $a Zahl2: $b"

    if [ $a -lt $b ] then kz=$a gz=$b elif [ $b -lt $a ] then kz=$b gz=$a else echo "Die Zahlen sind gleich. Das kgV ist daher ebenso $a" fi

    until [ "$remainder" -eq 0 ] do let "kgv = $gz * $count" let "remainder = $kgv % $kz" let count++ done

    echo "Das kleinste gemeinsame Vielfache von $a und $b ist $kgv" </highlightSyntax>

    Mathe-Lexikon.Kleinstes-Gemeinsames-Vielfaches, [1]

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.