I am stuck on this question
Produce a program which requests the inputs of ten floating point numbers between zero and one hundred and stores these numbers in an array. The program should then print the array, calculate the minimum and maximum numbers entered and their average.
My code is :
#include <stdio.h>
int main()
{
int i;
int size;
int *myArray;
printf("How many numbers \n");
scanf_s("%d",&size);
}
for (i=0;i<size;i++)
{
printf("%d\n",myArray[i]);
}
delete (myArray);
}
When I get to printf("insert number") I enter a number but the system does not respond
Anyone got any ideas what I am doing wrong
Thanks
Thanks for that
I have done what you suggested but when I type a number after the question insert number it does not recognise the first number I type but recognises the second number I insert but still fails to work.
Have you got any ideas
I am new at this sorry for being a bit slow on the uptake
thanks
My next problem is I have to find the largest, smallest and the average of the 10 numbers I type in
this is the code I used
int largest;
int numbers[10];
largest=numbers[0];
while(i<10)
{
if(numbers[i]>largest)
{
largest=numbers[i];
}
i++;
}
printf("\n The largest number is : %d\n",largest);
Anyone got any ideas
Thanks