Saturday 31 October 2020

A Swift program on functions without parameters

 In this program we are creating a function without parameters


func behaviour()

    {

       print("Biting: Both venomous and non-venomous species of snakes have fangs that they use to attack prey and defend themselves from threats.")

    }

    func habits()

    {

        print("Snake Diet: All snakes are carnivores, but their specific diets typically vary with their species and habitats.\nCommon snake foods include:  Insects, Eggs, Other Snakes, Lizards, Rabbits")

    }

No comments:

Post a Comment