Identify the output of the following C code:
What will be the output of the following C++ code?
What do container adapters provide to the interface?
What is the output of the following C program?
#include <stdio.h>
int x = 90;
int main()
{
int x = 10;
printf("%d", x | ::x);
}
Which option is best to eliminate the memory leak problem?
unsigned char half_limit = 150;
for (unsigned char i = 0; i < 2 * half_limit; ++i)
{
// do something;
}
#include<stdio.h>
int main()
{
int a = 1;
printf("size of a is %lu", sizeof(++a));
printf("\nValue of a is %d", a);
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int f(int p, int q)
{
if (p > q)
return p;
else
return q;
}
main()
{
int a = 5, b = 10;
int k;
bool x = true;
bool y = f(a, b);
k =((a * b) + (x + y));
cout << k;
}
Find out the errors in the following code.
1.int main()
2.{
3. int x, y, z;
4. for(x=y=0; x<10; x++, y+=2)
5. {
6. if((y-x)<=2)
7. {
8. printf("%d\n", (z=y-x));
9. }
10. else
11. {
12. printf("%d\n", x);
13. }
14. }
15.}