ExamVeda
Login
Home
21
Pick the incorrect statement about Character-Array.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
22
What will be the output of the following C++ code?
#include <stdio.h> 
#include<iostream>
using namespace std;
int main()
{
    int x = 5, y = 5, z;
    x = ++x; y = --y;
    z = x++ + y--;
    cout << z;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
23
What will be the output of the following C++ code?
#include <stdio.h> 
#include<iostream>
using namespace std;
int main()
{
    int num1 = 5;
    int num2 = 3;
    int num3 = 2;
    num1 = num2++;
    num2 = --num3;
    cout << num1 << num2 << num3;
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
24
Which of the following is correct way of concatenating two string objects in C++?
way 1:
string s1 = "hello";
string s2 = "world";
string s3 = s1 + s2;
 
way 2:
string s1 = "hello";
string s2 = "world";
string s3 = s1.append(s2);
 
way 3:
string s1 = "hello";
string s2 = "world";
string s3 = strcat(s1,s2);
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What does the data type defined by union will do?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
26
What is the name of | operator?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
27
In which direction does the assignment operation will take place?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
Which category of data type a class belongs to?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class sample
{
    private:
    int a, b;
    public:
    void test()
    {
        a = 100;
        b = 200;
    }
    friend int compute(sample e1);
};
int compute(sample e1)
{
    return int(e1.a + e1.b) - 5;
}
int main()
{
    sample e;
    e.test();
    cout  << compute(e);
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
30
Which operator works only with integer variables?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board