Home / MCQ Bank / Computer
Computer Arrays And Strings Difficulty: Medium

int a [ 5 ] = { 1,2,3 } What is the value of a [ 4 ] ?

Select the correct option to test your answer:

More Computer Questions

Which of the following function is used to insert an element at the end of a vector? In which situation is Merge Sort particularly useful? What is the default format for "Date" data type? What is the time complexity of the following dynamic programming algorithm used to find the maximum sub-array sum? #include<stdio.h> int max_num(int a,int b) { if(a> b) return a; return b; } int maximum_subarray_sum(int *arr, int len) { int sum[len], idx; sum[0] = arr[0]; for(idx = 1; idx < len; idx++) sum[idx] = max_num(sum[idx - 1] + arr[idx], arr[idx]); int mx = sum[0]; for(idx = 0; idx < len; idx++) if(sum[idx] > mx) mx =sum[idx]; return mx; } int main() { int arr[] = {-2, -5, 6, -2, 3, -1, 0,-5, 6}, len = 9; int ans = maximum_subarray_sum(arr, len); printf("%d",ans); return 0; } Select a convenient declaration and initialization of a floating point number: