Write a Program to find whether the given number is a Armstrong number.
Devise a program to implement the Fibonacci sequence.
Write a Program to find the number of words in a sentence.
How can you print an address of a variable?
Write a program to Print the Pascal triangle
Write a Program for matrix multiplication.
Write a Program to find the reverse of a given number.
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
Write a program that will convert an integer pointer to an integer and vice-versa.
Write a program that implements a date class containing day, month and year as data members. Implement assignment operator and copy constructor in this class.
Write code that allows to create only one instance of a class?
Write code to add functions, which would work as get and put properties of a class?
Write code to make an object work like a 2-d array?
Write a code snippet to display an integer in a binary format?