I'm trying to make this set two arrays each of 10 numbers, which are defined by the user, and then print out on one line.
Currently, it asks and stores the first 10, then asks the second but immediately prints a peculiar number.
What am I doing wrong?
Should I have two counts instead of one?
Code:
#include<stdio.h>
void main()
{
int list[10];
int list1[10];
int count = 0;
printf("Enter 10 numbers:");
while (count < 11)
{
scanf("%d", &list[count]);
count++;
break;
}
printf("Enter a new set of 10 numbers:");
while (count < 21)
{
scanf("%d", &list1[count]);
count++;
break;
}
printf("%d%d", list, list1);
return;
}