Here is my solution, which bit don't you understand?
Here is a link where you can see the code better: https://onlinegdb.com/HyD-twJDU
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
#include <math.h>
int main()
{
const int numElements = 100; // this is the number of elements in the array
float x[numElements]; // here we define 'x' which is an array of floats with size 'numElements'
// here we count from 0 to 'numElements'
for (int index = 0; index < numElements; index++)
{
float indexAsFloat = (float)index; // we need to convert it to a floating point type.
float value = sqrtf(index); // find the square rooot of this index.
x[index] = value; // the element of array x at this index is now set to value.
}
for (int i = 0; i < numElements; i++)
{
float value = x[i];
printf("Index: %u = %f\n", i, value);
}
return 0;
}