Write a fucntion to create a dynamic array of integers call

Write a fucntion to create a dynamic array of integers. call this function IntArrayCreate. The array created should be the first parameter to the function and the size of the array should be the second parameter.

Solution

Doing in C as well in Java as language is not mentioned.

#include<stdio.h>

#include<stdlib.h>

void IntArrayCreate(int *arr,int n){

printf(\"Do Nothing\");

}

int main(){

int *arr = (int *)malloc(10*sizeof(int));

IntArrayCreate(arr,10);

}
============================================================

Java




public class HelloWorld{


static void IntArrayCreate(int []arr , int n){

System.out.println(\"Hello World\");

}
public static void main(String []args){
int arr[] = new int[10];
IntArrayCreate(arr, 10);

}
}
======================================================================


Write a fucntion to create a dynamic array of integers. call this function IntArrayCreate. The array created should be the first parameter to the function and t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site