Un-Answered Questions { Programming Code }

Write a Program to find whether the given number is a Armstrong number.

523


Devise a program to implement the Fibonacci sequence.

527


Write a Program to find the number of words in a sentence.

517


How can you print an address of a variable?

501


Write a program to Print the Pascal triangle

513


Write a Program for matrix multiplication.

497


Write a Program to find the reverse of a given number.

480


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; }

629


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; }

569


Write a program that will convert an integer pointer to an integer and vice-versa.

513


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.

530


Write code that allows to create only one instance of a class?

482


Write code to add functions, which would work as get and put properties of a class?

485


Write code to make an object work like a 2-d array?

469


Write a code snippet to display an integer in a binary format?

486