Un-Answered Questions { Programming Code }

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

581


Devise a program to implement the Fibonacci sequence.

610


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

618


How can you print an address of a variable?

582


Write a program to Print the Pascal triangle

588


Write a Program for matrix multiplication.

596


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

571


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

734


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

678


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

611


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.

628


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

566


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

580


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

570


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

579