basic c++ programs for it students and Beginners
- Write a program to generate the following series (using class fibo) : 1 1 2 3 5 8 …..
- Write a program to print factorial of N. (Using class fact)
- Build a class person, which contains person name, age and city as data members and member functions getdata( ) and printdata ( ). Write a C++ program to read and display a person data.
- Define a class student, which accept student number, name and marks of three subjects. Calculate total and percentage using different member functions. (For single student only) Output: Student Number : …… Student Name : …… Marks 1 : ….. Marks 2 : ….. Marks 3 : ….. Total : …. Percentage : …..
- Write a C++ program to build a class myarray having integer array as a data member and following member function. [i]. void sort_asc() : To sort an array in ascending order. [ii] void sort_desc() : to sort an array in descending order. Write menu driven program for sorting either ascending or descending order and also for exit from a program.
- Write a C++ program to build a class String and write down the following member functions for string manipulation. [i]. strlen1() : To count the length of the string. [ii]. strcpy1() : To copy one string to another. [iii]. strcat1() : To combine two string into one. [iv]. strcmp1() : To compare two string.
- To make a class string, which contain a character array. Write a C++ program to display the menu as shown below and perform the task according to the menu. MENU -------------------------------
- Reverse the String
- Convert the String to uppercase
- Convert the String to lowercase
- Print the Length of the String
- Exit Enter your choice…