If I enter the number 5, this loop should run 5 times, but it works 6 times. What is the problem?
int main(){ int i, *arr, size; printf("Please enter the Number: "); scanf("%d ",&size); arr = (int*) malloc(size * sizeof(int)); for(i = 0; i < size; i++){ scanf("%d ", &arr[i]); } }
c loops scanf
Murali krishna
source share