Sie sind auf Seite 1von 2

Bijendra Singh NSIT Exercises for C++ Programming 1. Write a program to read and add n floating point numbers.

Print the sum to the nearest integer. 2. Write a program to print the permutation of n (<5) numbers. 3. Write a program to print the following pattern on the screen. * * * * * * * * * * * * * * * 4. Write a program to find the roots of a quadratic equation. 5. Using recursion write the programs to perform the following operations: a. Generate the Fibonacci series b. Compute the factorial of an integer c. Find the maximum among n numbers. d. Reverse a string and number e. Sum of digits of an integer 6. Write a program to print a number in words. 7. Sort the n numbers into ascending order using the following algorithms: a. Bubble Sort b. Selection Sort c. Quick Sort d. Heap Sort e. Insertion Sort f. Merge sort 8. Write a program that converts a number entered in Roman numerals to decimal using the classes; whose object will have following functionality: a. Store the number as Roman numerals. b. Convert ,store and print the number into decimal 9. Design a class to include title, authors (upto 4), publisher, ISBN, price, number of copies and year of publication of a book. Include the member functions to perform the various operations required to maintain a library. 10. Create a class Point to store, display, find distances between to points, find middle point between two points, returning abscissa, returning ordinate and returning a point in the 2D space. Use constructors and destructors for this class. 11. Create a class point for (x,y). Extend it to class circle, rectangle. Extend these classes to sphere and box (could be cube also). Use the required copy constructors / constructors and destructors. 12. Extend the classes of problem 11 to a cylinder class. Write various member functions also using overloading or overriding. 13. Using operator overloading, constructors, destructors and other member functions create a class to perform addition, subtraction and multiplication operations over matrices. 14. Using classes and operator overloading manipulate the operations on strings.

++

SI T

Page 1/2

Bijendra Singh NSIT 15. Using classes perform the operations addition and subtraction on the rational fractions. 16. Perform various operations on the complex numbers using classes. 17. Write the operation insert, delete, display over an array using it as an object. 18. Write a program to show the function of friend function. 19. Write a program to perform various functions of an inventory management system. 20. Write a program to perform the various operations on linked list and stack. 21. Write a program for the tic-tac-toe game. 22. Write a program to find the path in a maze. 23. Write a program to print the magic square of any order. 24. Write a program to perform various operations on polynomials. 25. Write a program to count the frequencies of words in a text.

++

N
Page 2/2

SI T

Das könnte Ihnen auch gefallen