Which of the following will not return a value?
What is the output of the following C program?
What will be the output of the following C++ code?
What is important difference between structure & union?
What will be the output of the following C++ code that generates all permutations of the array {0, 1, 2}?
What is the output of the following code?
#include<stdio.h>
int main()
{
printf(" "ABEKUS %% AND %% ABEKUS"");
getchar();
return 0;
}
In the given below code, if a short int value is 5 bytes long, then how many times the while loop will get executed?
#include<stdio.h>
int main ()
{
int j = 1;
while(j <= 300)
{
printf("%c %d\n", j, j);
j++;
}
return 0;
}
Consider the following code snippet:
1. int sum[len], idx;
2. sum[0] = arr[0];
3. for(idx = 1; idx < len; idx++)
4. sum[idx] = max(sum[idx - 1] + arr[idx], arr[idx]);
5. int mx = sum[0];
6. for(idx = 0; idx < len; idx++)
7. if(sum[idx] > mx)
8. mx =sum[idx];
9. return mx;
Let int a[42]; be an array, then all three expressions a and &a and &a[0] evaluate to a pointer to the first element of the array, i.e., the following equalities hold:
(void *) a == (void *)&a
(void *) a == (void *)&a[0]
(void *)&a == (void *)&a[0]
Does this mean that all three expressions mean exactly the same and
therefore can be used interchangeably?
Consider the following code snippet:
1. int sum[len], idx;
2. sum[0] = arr[0];
3. for(idx = 1; idx < len; idx++)
4. sum[idx] = max(sum[idx - 1] + arr[idx], arr[idx]);
5. int mx = sum[0];
6. for(idx = 0; idx < len; idx++)
7. if(sum[idx] > mx)
8. mx =sum[idx];
9. return mx;