I need to create a function in c that gets 20 numbers -1 to stop and store it in a array.
So the teacher is asking:
Use a separate function for each of these actions:
1. Get the integers from user.
So the way I would write it normally is:
printf("Enter integers. (Negitive -1 to stop):\n");
for (i=0; i < 20; i++)
{
scanf("%d", &nums[i]);
count = count +1;
if(nums[i] == -1 )
break;
Now I need to write that in a function...

New Topic/Question
Reply



MultiQuote



|