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


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ Code Interview Questions

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

0 Answers   Jomo Kenyatta University,


Seat Reservation prog for the theatre. Write a function for seat allocation for the movie tickets. Total no of seats available are 200. 20 in each row. Each row is referred by the Character, "A" for the first row and 'J' for the last. And each seat in a row is represented by the no. 1-20. So seat in diffrent rows would be represented as A1,A2....;B1,B2.....;........J1,J2... Each cell in the table represent either 0 or 1. 0 rep would seat is available , 1 would represent seat is reserved. Booking should start from the last row (J) to the first row(A). At the max 20 seats can be booked at a time. if seats are available, then print all the seat nos like "B2" i.e (2 row, 3 col) otherwise Print "Seats are not available." and we must book consecutive seats only.

1 Answers   Nagarro,


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.

3 Answers   TCS, Vimukti Technologies, Wipro,


Deriving time complexity of Binary tree and AVL tree, step by step.

4 Answers   NetApp,


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,






write a program that can LOCATE and INSERT elements in array using c++ programming languages.

0 Answers  


Hello, I am trying to write a program in c++ which accepts month and year from the user and prints the calender. So please tell me the algorithm and what is the calender logic.

0 Answers  


Complexity T(n) Write a linear-time algorithm that sorts n distinct integers, each of which is between 1 and 500. Hint: Use a 500-element array. (Linear-time means your algorithm runs in time c*n + b, where c and b are any constants that do not depend on n. For example, your algorithm can run in time n, or time 2n + 1, or time 5n + 10, or time 100n + 6, but not time c*n*n = c*n?.)

1 Answers   Qatar University,


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

0 Answers  


How reader and writer problem was implemented and come up with effective solution for reader and writer problem in case we have n readers and 1 writer.

6 Answers   Microsoft, NetApp,


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

0 Answers  


We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

0 Answers  


Categories