- Write a C++ program to find the sum of individual digits of a positive integer.
- A
Fibonacci sequence is defined as follows: the first and second terms in
the sequence are 0 and1.Subsequent terms are found by adding the
preceding two terms in the sequence.Write a C++program to generate the
first n terms of the sequence.
- Write a C++ program to generate all the prime numbers between 1 and n ,where n is a value supplied by the user.
- Write C++ programs that use both recursive and non-recursive functions
a) To find the factorial of a given integer.
b) To find the GCD of two given integers.
c) To find the nth Fibonacci number. - Write a C++ program that uses a recursive function for solving Towers of Hanoi problem.
- Write a C++ program that uses functions
a) To swap two integers.
b) To swap two characters.
c) To swap two reals.
Note: Use overloaded functions. - Write a C++ program to find both the largest and smallest number in a list of integers.
- Write a C++ program to sort a list of numbers in ascending order.
- Write a C++ program that uses function templates to solve problems-7&8.
- Write a C++ program to sort a list of names in ascending order.
- Write a C++ program to implement the matrix ADT using a class. The operations supported by this ADT are:
a) Reading a matrix. c) Addition of two matrices.
b)Printing a matrix. d)Multiplication of two matrices. - Implement the matrix ADT presented in the problem-11 using overloaded operators (<<, >>, +, *) and templates.
- Implement the complex number ADT in C++ using a class. The complex ADT is used to represent complex numbers of the form c=a+ib, where a and b are real numbers.
The operations supported by this ADT are:
a) Reading a complex number.
b) Writing a complex number.
c) Addition of two complex numbers.
d) Multiplication of two complex numbers. - Write a C++ program that overloads the + operator and relational operators (suitable) to perform the following operations: a) Concatenation of two strings. b)Comparison of two strings.
- Implement the complex number ADT in C++ using a class. The complex ADT is used to represent complex numbers of the form c=a+ib, where a and b are real numbers.
The operations supported by this ADT are:
a) Reading a complex number.
b) Writing a complex number.
c) Addition of two complex numbers.
d) Multiplication of two complex numbers.
Note: 1. overload << and >> operators in part a) and part b).
2. overload +, * operators in parts c) and d). - Write a template based C++ program that determines if a particular value occurs in an array of values.
- Write a C++ program that uses functions to perform the following operations:
a) Insert a sub-string into the given main string from a given position.
b) Delete n characters from a given position in a given string. - Write a C++ program that uses a function to reverse the given character string in place, without any duplication of characters.
- Write a C++ program to make the frequency count of letters in a given text.
- Write a C++ program to count the lines, words and characters in a given text.
- Write a C++ program to determine if the given string is a palindrome or not.
- Write a C++ program to make frequency count of words in a given text.
- Write a C++ program that displays the position or index in the string S where the string t begins , or –1 if S doesn’t contain t.
- 2’s complement of a number is obtained by scanning it from right to left and complementing all the bits after the first appearance of a 1. Thus 2’s complement of 11100 is 00100. Write a C++ program
to find the 2’s complement of a binary number. - Write a C++ program that counts the number of 1 bits in a given integer.
- Write a C++ program to generate Pascal’s triangle.
- Write a C++ program to construct of pyramid of numbers.
- Write a C++ program to compute the Sine series.
- Write a C++ program that converts Roman numeral into an Arabic integer.
- Write a C++ program which converts a positive Arabic integer into its
corresponding Roman Numeral. - Write a C++ program to display the contents of a text file.
- Write a C++ program which copies one file to another.
- Write a C++ program to that counts the characters, lines and words in the text file.
- Write a C++ program to change a specific character in a file.
Note: Filename , number of the byte in the file to be changed and the new character are specified on the command line. - Write a C++ program to reverse the first n characters in a file.
- Write a C++ program that uses a function to delete all duplicate characters in the given string.
- Write a C++ program that uses a function to convert a number to a character string.
- Write a C++ program that uses a recursive function to find the binary equivalent of a given non- negative integer n.
- Write a C++ program to generate prime numbers up to n using Sieve of Eratosthenes method.
- Write a C++ program
a) To write an object to a file.
b) To read an object from the file. - Write C++ programs that illustrate how the following forms of inheritance are supported:
a) Single inheritance
b) Multiple inheritance
c) Multi level inheritance
d) Hierarchical inheritance - Write a C++ program that illustrates the order of execution of constructors and destructors when new class is derived from more than one base class.
- Write a C++ program that illustrates how run time polymorphism is achieved using virtual functions.
- Write a C++ program that illustrates the role of virtual base class in building class hierarchy.
- Write a C++ program that illustrates the role of abstract class in building class hierarchy.
c++ programs for MCA first sem students of JNTU
Wednesday, 31 July 2013
Programs List
Subscribe to:
Posts (Atom)