I need help for this code, i tried many times but i couldn't get it working.
Write C program fragnments to allocate dynamic memory for an integer array with 100 elements and then initialise each of the array elements to -1.
This is what i wrote
int*array = (int*)malloc(sizeof(int)*100);
for (int i = 0; i<100; i++
*(array + i) = -1;