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;
}
No Answer is Posted For this Question
Be the First to Post Answer
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
what is the best algorithm to sort out unique words from a list of more than 10 million words(1 crore+)? we need the best technique in the terms of execution time.
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
Write a program using one dimensional array that searches a number and display the number of times it occurs on the list of 12 input values. Sample input/output dialogue: Enter 12 values: 13 15 20 13 30 35 40 16 18 20 18 20 Enter number to search: 20 Occurences: 3
write a program using virtual function to find the transposing of a square matrix?
Write code for the multiplication of COMPLEX numbers?
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
hello friends, given an expression we have to remove the unwanted brackets in that expression. Eg : (a+b) ---> a+b (a+b)*(c)-----> (a+b)*c. Please mail me if you know the logic. My mail id is : saravana6m@gmail.com. Thank you in advance :-)
1 Answers GrapeCity, Microsoft,
A Binary no. is given, we hav to find it's decimal equivalent.
Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.
0 Answers Nagarro, Wollega University,
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?