Rabu, 09 Desember 2009

6th task



Loops in prolog programme

  • We will make a looping to get know about the square of some number
  • Make a new notepad file then write the formula(look at the first picture).
  • Save file under the name loop1.pl
  • Now open loop1.pl, then write down outsquare(4,9)* then ‘ENTER’. You’ll see the result like this. We’ll see the result of squared from number 3until number 10 (we just need to write the command once and then the result will be looping if the condition is true )

























P.S
(4,9) : Actually you may write another number, but make sure that the first number is lower than second number.^^


    Tidak ada komentar:

    Posting Komentar