Hello everyone ..
I've got a problem with the random numbers in the array .. because it's give me a big numbers not small numbers and it doesn't change the numbers !! why ?? **Sorry for my English**
This is my code :
Code:#include <stdio.h> #include <stdlib.h> int main() { int arr[10]; int sum = 0; for (int i=0; i<10; i++){ arr[1] = rand() % 10; printf("arr[%d] = %d\n" , i , arr[i]); } for (int i=0; i<10; i++) { sum += arr[i]; } printf("the sum = %d", sum); return 0; }