Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated by one space.
Write a C/C++ program to sort a list of elements using the merge sort algorithm.
Note: Merge sort is an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output.
Write a program to sort an array of floating-point numbers in descending order using merge sort ?
Write a program in C++, which perform two operator overloading function for A=2*B,where A and B are the objects of the same class.
Write a program in C++, which perform two operator overloading function for A=2+B,where A and B are the objects of the same class.
create a plan for a program that will let the user to choose from circle or a rectangle.Must compute the area.
Exercise 1 : Practice to manipulate character arrays
A palindrome is a word, phrase, number or other sequence of characters which reads the same backward and forward.
Write a C program that enter a word, store it in an array and determine whether it is palindrome or not.
Example : CIVIC is a palindrome
HOT is a not a palindrome
Create a base class called building that stores the number of floors, rooms and area. Create a derived class called house that inherits building and store number of bedrooms and bathrooms. Create another derived class called office that inherits house and store number of window. now show everything creating office class object.
A toy shop has a unique way of selling their toys to children. As the shop opens the toys prices keeps increasing for every sale he makes. After some time the shopkeeper prefers to lower the price every sale he makes. For example , say the starting prices of the toy is Rs. 10. He decides to increase the price by 5 for 5 first entries and reduce the price by 5 there after. The list would be 10 15 20 25 30 25 20 15 10 5 0. Given this kind of pricing, every day he wants to find what is the maximum price a child had paid for the toy. Write a program to help the shop keep find the toys price in less than O(n) time. You will be given the array. The number of entries for which the shopkeeper decides to increase is kept as a secret.
Problem #4
Var x;
While (x <=5) {
Print ();
x = x + 1;
}
What is the answer?
1. If x = 3
Answer =
2. If x = 1
Answer =