Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write Ocaml programe to add all numbers in a list ? the solution : let rec sum list = match list with [ ] ->

write Ocaml programe to add all numbers in a list ?

the solution :

let rec sum list =

match list with

[ ] -> 0

| x:: tail -> x + (sum tail);;

let a = [2;4;5;6;1;9;10 ];;

sum a;;

question is :- Write a Ocaml program to multiply all numbers in a list a= [2;4;5;6;1;9;10 ]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

=+4 Are national cultures converging or diverging?

Answered: 1 week ago

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago