In SML programming write a function pow of type real * int -> real that raises a real number to an integer power. Your function need not behave well if the integer power is negative.
SOLUTION :-

==============================================================================================
In SML programming write a function pow of type real * int -> real that raises...
I need help solving this problem using the ML programming language Write a function sqsum of type int -> int that takes a non-negative integer n and returns the sum of the squares of all the integers 0 through n. Your function need not behave well on inputs less than zero
*****In SML/NJ****** 1. Write a function count_list with type int list -> int that returns the number of items in a list. An item that is repeated is counted each time it appears in the list. 2. Write an ML function sum_list with type int list -> int that returns the sum of all the elements within a list 3. Write a function countdown with the type int -> int list that returns a list of numbers from its argument...
in ml language or sml
Exercise 14 Write a function maxpairs of type (int * int) list -> int lise that takes a list of pairs of integers and returns the list of the max elements from each pair. For example, if you evaluate maxpairs ((1,3), (4,2), (-3,-4)] you should get [3,4,-3).
Define a function in SML, called "less" of type int * int list -> int list so that less(e,L) is a list of all the integers in L that are less than e.
C
Programming
23 points Write a function for the following specs: type: void parameters: FILE", int[], int size • Behavior: Write the text value of each element from the int[] to the file File format: an integer on each line of the file. Le: 4 3 1 5
C PROGRAMMING ONLY
22 2 points Write a function for the following specs: • type: int • parameter: character array • Behavior: o Open the file using the parameter for the file name in read mode. o Return O if the file opened successfully, 1 if unable to open the file. В І о A- A Ex x, EE 12 23 2 points Write a function for the following specs: type: void • parameters: FILE", int[], int size Behavior: o...
20. [5 points] Rewrite the following ML. function using patterns fun factn. ifn-0 then 1 else n fact (n-1) 21. [S points) Using map function, write an ML function int2real of type int list real list that takes a list of integers and returns the same numbers converted to real. For example, if the input is [1,2,3], the output should be like [1.0,2.0,3.0 22. [5 points] Using foldr function, write a function duplist of type·a list 'a list that takes...
#include <stdio.h>
..
int main(int argc, char *argv[])
{
int base, power;
printf("enter base and power: ");
scanf("%d %d", &base, &power);
while (base != -100){
double res = pow(base, power);
double res2 = my_pow(base, power);
printf("pow: %.4f\n", res);
printf("my_pow: %.4f\n", res2);
....
}
return 0;
}
// this function should be RECURSIVE
// should not use any loop here
double my_pow(double base, double p)
{
}
lab4pow.c file contains:
2.1 Specification Write an ANSI-C program that reads input from the...
Write a function getScores(...) that is given a string, an int type array to fill and the max number of elements in the array as parameters and returns an integer result. The function will find each substring of the given string separated by space characters and place it in the array. The function returns the number of integers extracted. For example: int values[3]; getScores("123 456 789", values, 3 ); would return the count of 3 and fill the array with...
C
Programming
222 2 points Write a function for the following specs: • type: int parameter: character array Behavior: • Open the file using the parameter for the file name in read mode. • Return Oif the file opened successfully, 1 if unable to open the file.