Ask 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 and then print the array after the values have been populated in c

+3
Answers (1)
  1. 28 May, 10:05
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers