[Solved] I have to write a program which accepts n number of integers and display the degree of the array [closed]
This is kind of naughty: int main(int argc, char**argv) { argv++; int n = argc – 1; int arr[n]; for(int i = 0; i < n; i++) { arr[i] = atoi(argv[i + 1]); } printf(“%d\n”, degreeOfArray(arr, n)); } Argc is 4. You increment argv (which is naughty). n is 3. arr has values [0] through … Read more