Question

C programing

Write a function that takes in an integer as input and returns an
integer array of zeros.

Answer #1

int *generate_array(int size) { int *arr = (int *) malloc(sizeof(int) * size), i; for (i = 0; i < size; ++i) { arr[i] = 0; } return arr; }

C programing
Write a function that takes an array of integers and applies
another function (f(x)= 3x+4) on each element and then stores the
result in another array and finally return it once it is done.

C Programming:
Write a function that takes in an array of integers and an
integer containing the count of elements, then have it returns the
sum of all the even values inside the array.

Write a function makeDoubles in c++, that takes an integer parameter called size and:
allocates a new array of that many double's
initializes all elements to be 0
returns this array

In C++ Using recursion write a program that takes a positive
integer number and returns whether there is 6. For example, if the
input number is 7068, the function returns true

Write a function
called TaylorSin.m that takes as input an array x, and positive
integer N, and returns the Nth Taylor polynomial approximation of
sin(x), centered at a = 0. The first line of your code should
read
function s =
TaylorSin(x,N)
HINT: in computing k!,
use kfact = k*(k-1)*kfact since you are counting by 2

For C++:
a) Write a function is_prime that takes a positive integer X and
returns 1 if X is a prime number, or 1 if X is not a prime
number.
b) write a program that takes a positive integer N and prints
all prime numbers from 2 to N by calling your function is_prime
from part a.

In R- Studio : Write a function that takes as an input a
positive integer and uses the print() function to print out all the
numbers less than the input integer. (Example: for input 5, the
function should print the numbers 1,2,3,4 { for input 1, the
function should not print a number.) Write a recursive function, do
not use any of the loop commands in your code.

Write a function in c using #include <stdio.h> that takes
a one-dimensional integer array and returns the index of the first
occurance of the smallest value in the array. Your function must be
able to process all the elements in the array. Create a function
prototype and function definition (after the main function). Your
main function should declare a 100 element integer array. Prompt
the user for the number of integers to enter and then prompt the
user for each...

Write a method which takes as input an integer, returns true if
the integer is prime, and returns false otherwise. Do not import
anything.
If the input is negative, 0 or 1, false should be returned.
If the input x is greater than 1, you can test if it is prime
(inefficiently) by checking if it is divisible by any integer from
2 up to half of x. If it is not divisible by any of these numbers,
then it...

Write a function in C++ that takes an integer argument D and
returns the index and value of the first D-digit Lucas number. Turn
in a print-out of your code, as well as the index and value your
function returns when D = 15. Example) Let D = 3. The first 3-digit
Lucas Number is L10 = 123, so your function should return something
like firstDDigitLucas(3) = (10, 123).

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 19 minutes ago

asked 33 minutes ago

asked 33 minutes ago

asked 33 minutes ago

asked 34 minutes ago

asked 52 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago