Answer the question
In order to leave comments, you need to log in
How to generate an array with multiples of 7 in C?
How to generate an array with multiples of 7 in C?
here is a sample code
int main() {
srand(time(0));
int arr[N],a,b;
printf("A: "); scanf_s("%d", &a);
printf("B: "); scanf_s("%d", &b);
for (int i = 0; i < N; i++) {
arr[i] = a + rand() % b *7;
printf("%4d", arr[i]);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question