C++ Code Interview Questions
Questions Answers Views Company eMail

Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2915

Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

2150

void main() { int i,j=2; for(i=0;i<3;i++) if(j=i) cout<<"Lotus "; else cout<<"Rose "; } Its result is Rose Lotus Lotus.. How? Explain it?

2 6636

How to swap two ASCII numbers?

2449

Find the maximum product of three numbers in an array? Eg. 9,5,1,2,3 Max product= 9*5*3= 135 The array can hav negative numbers also..

CTS,

7 21646

Write code for the multiplication of COMPLEX numbers?

IBM,

3330

Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2064

1+1/2!+1/3!+...+1/n!

1945

i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.

1969

Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

Facebook, Webyog, Wipro,

4577

output for printf("printf");

1985

write a program that reverses the input number of n.Formulate an equation to come up with the answer.

Satyam,

7037

i don't know about working of nested for loop can any one help me

1793

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

3264

A research student is given a singly-linked list. Each node of the list has a color, which is either “Black” or “White”. He must find if there are more black nodes than white nodes, or vice versa. His advisor gives him 5,000Rs to buy a computer to do the work. He goes to the computer store and finds a slightly defective computer which costs a mere 3,000Rs. This computer has the small problem of not being able to do arithmetic. This means that he cannot use a counter to count the nodes in the list to determine the majority color. The computer is otherwise fully functional. He has the evil idea that he could buy the defective computer and somehow use it to do his work, so that he can use the rest of the money on enjoyment. Show how he can accomplish this amazing task. Write code for an algorithm called ‘findMajorityColor’ which takes a singly-linked list, L, with n nodes and returns the majority color among nodes of L. This algorithm should have the same asymptotic running time as counting the nodes (O(n)). Note: No arithmetic is allowed.

2 4006


Post New C++ Code Questions

Un-Answered Questions { C++ Code }

solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2934


Write a simple encryption program using string function which apply the substitution method.

5538


develop a program to calculate and print body mass index for 200 employees

2213


Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7339


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

644






can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2745


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2049


1+1/2!+1/3!+...+1/n!

1945


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

578


Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

3191


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2220


Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

2150


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2064


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2403


what mean void creat_object?in public class in this code class A{ public: int x; A(){ cout << endl<< "Constructor A";} ~A(){ cout << endl<< "Destructor A, x is\t"<< x;} }; void create_object(); void main() { A a; a.x=10; { A c; c.x=20; } create_object(); } void create_object() { A b; b.x=30; }

2065