Algorithm for water jug problem:
1.include the header files
2. using the init() graph, set the graphics path
3. call the input function to get the inputs from user
4. define the functions such as initial(),fill3(),fill4(),empty3(),empty4(),transfer(),tin4().
5. Initial() function, draw 3LITRE jug, 4LITRE jug and pipe to transfer between jugs
6. Fill3() function, set the color as light blue and fill the 3litrejug.
7. Fill4() function, set the color as light blue and fill the 4LITRE jug.
8. Empty3() function, set the color as black and empty the 3LITRE jug.
9. Empty4() function, set the color as black and empty the 4LITRE jug.
10. Transfer water from 3LITRE to 4LITRE by setting color as light blue and fill the water in 4LITRE jug using the function transfer().
11.Function tin4(), transfer the 1litre of water from 3LITRE to 4LITRE and set magenta color inside the pipe and the outer edges with green to indicate transfer function is over.