What will be the output of the following C++ code?
What parameter is used for the rehash() method in the unordered_set in C++?
Find the odd one out.
What is the output of the following program?
main()
{
int a=1, b=2, c=3;
a = b = c;
printf("%d", a);
}
Consider the following program:
main()
{
int a[5] = {1, 3, 6, 7, 0};
int *b;
b = &a[2];
}
What is the value of *(b-1)?
The size_t integer type in C++ is?
What is the output of the following C++ code?
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<-5-5-5;
return 0;
}
What will be the output of the following C++ code that manipulates a text file?
#include <stdio.h>
int main() {
if (remove("myfile.txt") != 0)
perror("Error");
else
puts("Success");
return 0;
}
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
do
{
i++;
printf("In while loop\n");
} while (i < 3);
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int myints[] = {10, 20, 30, 30, 20, 10, 10, 20};
vector<int> v(myints, myints + 8);
sort(v.begin(), v.end());
vector<int>::iterator low, up;
low = lower_bound(v.begin(), v.end(), 20);
up = upper_bound(v.begin(), v.end(), 20);
cout << (low - v.begin()) << ' ';
cout << (up - v.begin()) << '\n';
return 0;
}