MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

Arrays/04_Array_ADT.c:19–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 printf("%d ",arr.A[i]); // it will display all the elements
18}
19int main()
20{
21 struct Array arr;
22 int n; // how many no is going to be inserted
23 int i;
24 printf("Enter size of an array ");
25 scanf_s("%d", &arr.size);
26 arr.A = (int*)malloc(arr.size * sizeof(int)); // dynamically created array
27 arr.length = 0;// intially no elements
28 printf("Enter number of numbers ");
29 scanf_s("%d", &n);
30 printf("Enter All the elements ");
31 for (i = 0; i < n; i++)
32 scanf_s("%d", &arr.A[i]); // enter the elements of an array
33 arr.length = n; // set length as n
34
35
36 Display(arr);
37
38
39 return 0;
40}

Callers

nothing calls this directly

Calls 1

DisplayFunction · 0.70

Tested by

no test coverage detected