what is virtual constroctor ? give an exam for it?-(parimal
dhimmar)
Answers were Sorted based on User's Feedback
Answer / subhashish sen
Constructor can not be virtual.becoz constuctor is an entity
which initializes the V-table(V-table stores the addresses
of all virtual member functions of a class.)So if we declare
a constructor as virtual then who will inialize V-table for
this constructor??Thats why constructor can never be virual.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / john
virtual constructor is not possible.
This is because v-table is created only after the
constructor is called.
Is This Answer Correct ? | 4 Yes | 0 No |
write a function – oriented program that calculates the sum of the squares from 1 to n. thus, if the input is 3, the output is 14
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
5 Answers ADP, Amazon, HCL, IBM, Infosys, Satyam, TCS, Vimukti Technologies,
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
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,
write a function -oriented program that generates the Fibonacci, the current numbers of n(as input) and display them (series). In Fibonacci, the current third number is the sum of the previous number.
PROBLEM #8 The cashier at the counter of a Super Store, Mr. Khazaanchi has the following bundles of rupee cash notes with him: Rs. 1, 2, 5, 10, 50, 100, 500, 1000 A customer comes at his counter with various items that he has shopped. Mr. Khazaanchi totals the item prices and tells the customer his total amount payable. The customer gives Mr. Khazanchi some amount of cash. Find the total number of rupee notes of each denomination (i.e. 1, 2, 5, 10, 50, 100, 500, 1000) Mr. Khazaanchi will have to give to the withdrawer ensuring that the total number of rupee notes are minimum.
Code for Two Classes for Doing Gzip in Memory?
using friend function find the maximum number from given two numbers from two different classes.write all necessary functions and constructor for the classes.
An array of size 5X5 is given to us. The elements from 1 to 25 are to be inserted in the array, such that starting from a particular position for an element i, the next element i+1can be inserted only at the mentioned positions (u,v), and if these all positions are occupied then it returns giving a count of how many positions have been occupied in the array: (u,v) = (x+/-3 , y) (u,v) = (x , y+/-3) (u,v) = (x+/-2 , y+/-2). Example: if the starting element is 1 with the given positions (1,2), then next element 2 can be placed at any one of the positions marked with *. _ _ _ _ _ 1 _ _ _ * _ _ _ _ _ _ _ * _ _ * _ _ _ _
Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …
1. Write a program that performs the following. The user inputs a number and then enters a series of numbers from 1 to that number. Your program should determine which number (or numbers) is missing or duplicated in the series, if any. For example, if the user entered 5 as the initial number and then entered the following sequences, the results should be as shown. Input Sequence Output ---------------------- --------------- 1 2 3 4 5 Nothing bad However, if 7 were the high number, the user would see the results on the right for the following number entries: Input Sequence Output ---------------------- --------------- 1 3 2 4 5 Missing 6 Missing 7 And if 10 were the high number and the user entered the numbers shown on the left, note the list of missing and duplicate numbers: Input Sequence Output ---------------------- --------------- 1 2 4 7 4 4 5 10 8 2 6 Duplicate 2 ( 2 times) Missing 3 Duplicate 4 ( 3 times ) Missing 9
write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000