Which of the following is NOT a Bitwise operator in C#.NET?
Practice Operators Questions –
Which of the following is NOT a Bitwise operator in C#.NET?
Which of the following is NOT a Bitwise operator in C#.NET?
Practice Operators Questions –
Which of the following is NOT a Bitwise operator in C#.NET?
Which of the following is NOT an Arithmetic operator in C#.NET?
Practice Operators Questions –
Which of the following is NOT an Arithmetic operator in C#.NET?
Which of the following statements is correct about the C#.NET code
Practice Structures Questions –
Which of the following statements is correct about the C#.NET code snippet given below?
struct Book {
private String name;
private int noofpages;
private Single price;
}
Book b = new Book();
Which of the following are NOT Relational operators in C#.NET?
<
Practice Operators Questions –
Which of the following are NOT Relational operators in C#.NET?
Which of the following statements is correct about constructors in
Practice Constructor Questions –
Which of the following statements is correct about constructors in C#.NET?
Which of the following statements are correct about constructors in
Practice Constructor Questions –
Which of the following statements are correct about constructors in C#.NET?
Which of the following will be the correct result of the statement
Practice Structures Questions –
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
struct Address {
private int plotno;
private String city;
}
Address a = new Address();
Address b;
b = a;
Which of the following statements is correct about the C#.NET code
Practice Relational Operators –
Which of the following statements is correct about the C#.NET code snippet given below?
class Trial {
int i;
Decimal d;
}
struct Sample {
private int x;
private Single y;
private Trial z;
}
Sample ss = new Sample();
Creating empty structures is allowed in C#.NET.
Practice Relational Operators –
Creating empty structures is allowed in C#.NET.
Practice Constructors and Destructors –
What will be the output of following program?
#include
using namespace std;
class Point
{
int x, y;
public:
Point(const Point &p) { x = p.x; y = p.y; }
int getX() { return x; }
int getY() { return y; }
};
int main()
{
Point p1;
Point p2 = p1;
cout << "x = " << p2.getX() << " y = " << p2.getY();
return 0;
}
Practice Constructors and Destructors –
What will be the output of following program?
#include
using namespace std;
class X
{
public:
int x;
};
int main()
{
X a = {10};
X b = a;
cout << a.x << " " << b.x;
return 0;
}
Practice Constructors and Destructors –
Predict the output of following program?
#include
using namespace std;
class Point {
public:
Point() { cout << "Normal Constructor called
"; }
Point(const Point &t) { cout << "Copy constructor called
"; }
};
int main()
{
Point *t1, *t2;
t1 = new Point();
t2 = new Point(*t1);
Point t3 = *t1;
Point t4;
t4 = t3;
return 0;
}
Practice Function Overloading –
Find the output of following program.
#include
using namespace std;
class Base
{
public:
virtual void show() { cout<<" In Base
"; }
};
class Derived: public Base
{
public:
void show() { cout<<"In Derived
"; }
};
int main(void)
{
Base *bp = new Derived;
bp->Base::show(); // Note the use of scope resolution here
return 0;
}
Practice Function Overloading –
Predict the output of following program?
#include
using namespace std;
class Base
{
public:
virtual void show() { cout<<" In Base
"; }
};
class Derived: public Base
{
public:
void show() { cout<<"In Derived
"; }
};
int main(void)
{
Base *bp, b;
Derived d;
bp = &d;
bp->show();
bp = &b;
bp->show();
return 0;
}
Practice Function Overloading –
What is the output of following program?
#include
using namespace std;
class Base
{
public:
virtual void show() { cout<<" In Base
"; }
};
class Derived: public Base
{
public:
void show() { cout<<"In Derived
"; }
};
int main(void)
{
Base *bp = new Derived;
bp->show();
Base &br = *bp;
br.show();
return 0;
}