C++ Code Interview Questions
Questions Answers Views Company eMail

Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

iGate,

3268

using friend function find the maximum number from given two numbers from two different classes.write all necessary functions and constructor for the classes.

TCS,

1 17096

Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

4445

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.

AR, ARJ,

1 5771

write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

HCL, SRCASW,

3952

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

HCL,

2394

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

HCL,

2214

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.

3389

main(){int a=5,b 10,c=2, d;a=b c;d=++a=(--c)*2; printf("%d%d%d%d,a,b,c,d; return o;}

1 3865

write a program that reads a series of strings and prints only those strings begging with letter "b"

2668

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

Jomo Kenyatta University,

2208

write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

Jomo Kenyatta University,

4300

write a program that calculate the volume of cylinder after user enters radius and height and show the algorithm used

Jomo Kenyatta University,

1 9666

write a program to calculate the radius for a quadratic equation use modular programming(function abitraction)hint use quadratic function

ICAN, Jomo Kenyatta University,

1 3914

write a program to convert temperature from fa height into celcius and vise versa,use modular programming

Jomo Kenyatta University,

2434


Post New C++ Code Questions

Un-Answered Questions { C++ Code }

write a program to perform generic sort in arrays?

2619


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

546


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

2434


how to write a program that opens a file and display in reverse order?

2561


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3393






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

2394


write a program using virtual function to find the transposing of a square matrix?

2837


find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L

2002


Code for Method of Handling Factorials of Any Size?

2000


write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

2364


write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

3362


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

2208


Code for Two Classes for Doing Gzip in Memory?

2807


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

7030


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3268