Un-Answered Questions { Code Snippets }

Write a program to Print the Pascal triangle

504


Write a Program for matrix multiplication.

486


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

465


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

615


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

562


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

495


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.

518


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

468


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

477


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

463


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

476


what is the structure of xml document ?

334


What is xml schema?

332


What is a cdata section in xml?

318


How to print sum of the numbers starting from 1 to 100?

417