Anda di halaman 1dari 3

11) Palindrome Number Accept an integer and check whether it s palindrome or not.

12) Prime Number Write a function isprime which checks whether given integer is pr ime or not. Use this in main to print all prime numbers till n.

13) Perfect Square Write a function perfect to check whether given integer is pe rfect square or not. Use this in main to display perfect square between given tw o integers. 14) Recursion Write a recursive function fact which returns factorial of given int eger. Use this to find combination of 2 numbers. nCr = n! / ( r! * (n r )!) 15) Sorting Write a function sort which sorts given array of integers. Program sho uld find given set of elements. (Median is the middle most element of the elemen t when sorted. It s an average of two middle most element if number of elements ar e even) 16) Matrix Multiplication Write a program to perform matrix multiplication of tw o matrices. Use separate functions read, display and product. 17) Call by reference Write a function compute which finds minimum, maximum and av erage of given array. All results computed by function must be displayed in main ( return type of function compute is void ) 18) Counting Words Accept a string and count number of words in it. 19) Sorting of Strings Accept n strings and sort them in alphabetical order. 20) Student Record A student structure stores name, roll number, marks of 10 tes ts (each out of 100), grand total and percentage. Accept records of n students, find their grand total and percentage and display them in descending order of th eir grand total. 21) Objects and Classes Create a class complex which stores real and imaginary p arts of a complex number. Provide following functions: read( ) to read a complex number display( ) to display a complex number in proper format modulus( ) returns modulus of complex number reverse( ) returns complex number by swapping real and imaginary partsq 22) Array of Objects Create a class player which stores name of player, country, runs scored in last 5 matches, total runs and batting average. Write a program to accept records of n players find their total runs and batting average. Displa y list of players in descending order of their batting average. Use separate mem ber functions getdata, putdata, sort (static function) and display.

23) Constructor and Destructor Create a class distance which stores a distance val ue in feet and inches. The class should suit the following main function. void main( ) { distance d1(4,8),d2(8,10),d3; d3=d1.add(d2); d3.display( ); if (d1.compare(d2)==1) cout<< Two distances are equal\n ; else cout<< Two distances are not equal\n ; } 24) Operator Overloading Create a class ratio which stores numerator and denomin ator of a ratio. Overload following operator as given + : adding two ratios - : subtracting two ratios * : multiplying two ratios / : dividing two ratios ! : find reciprocal of ratio 25) Inheritance Consider a class network given below. The class master derives i nformation from both account and admin classes which in turn derive information from class person. Define all the classes and write a program to create, update and display information contained in master objects.

Anda mungkin juga menyukai