0 Replies - 1012 Views - Last Post: 18 July 2010 - 11:15 AM

#1 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

[Scheme] Check whether X is divisible by Y

Posted 18 July 2010 - 11:15 AM

Description:
(define check(lambda ( x y )
    
             (cond
               
                ( (= 0 ( modulo x y ) ) ( display  x)(display " is divisible by " ) (display y ) )                
                ( else ( display  x)(display " is not divisible by " ) (display y ) ) 
               
               )  
  )
  
  )

Is This A Good Question/Topic? 0
  • +

Page 1 of 1