Ask Question
13 March, 22:11

Write a program that will prompt a user for the size of an array and then create the array and using rand () populate the array with values and then print the array after the values have been populated in c

+4
Answers (1)
  1. 14 March, 00:27
    0
    I'm assuming the array is of type float.

    #include

    #include

    int main (void)

    {

    int num;

    printf ("Enter the size of array: ");

    scanf ("%d", &num);

    float arraydat[num];

    for (int i = 0; i
    {

    arraydat[i] = scanf ("%d", rand ());

    }

    for (int i = 0; i
    {

    printf (" %d ", arraydat[i]);

    }

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that will prompt a user for the size of an array and then create the array and using rand () populate the array with values ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers