Ask Question
27 September, 16:41

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

+3
Answers (1)
  1. 27 September, 18:00
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers