What does the cerr represent?
Which parameter types are legal for non-type template parameters?
A function which invokes itself repeatedly until some condition is satisfied is called
In which type of storage location are the vector members stored?
What is the output of the following C program?
int main()
{
{
{
printf("FIRST..");
}
printf("SECOND..");
}
printf("THIRD..");
}
What is the output of the following C program?
int main()
{
unsigned int m;
int j;
m=65;
for(j=0;j<16;j++)
printf("%d",(m<<j & 1<<15)?1:0);
}
Which of the following statements are false regarding operator overloading?
What happens if the following C++ statement is compiled and executed?
int *ptr = NULL;
delete ptr;
What does the strcmp() function return when comparing two strings?
What is the output of the following C program?
#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[] = {-20, 23, 10, 3, -10, 11, -5}, len = 7;
int ans = maximum_subarray_sum(arr, len);
printf("%d", ans);
return 0;
}