Skip to content

Latest commit

 

History

History
180 lines (122 loc) · 9.94 KB

Syllabus_for_1st_Semester.md

File metadata and controls

180 lines (122 loc) · 9.94 KB

Practical / Lab work to be performed in C or C++

  1. Write a program to print the sum and product of digits of an integer.
  1. Write a program to reverse a number.
  1. Write a program to compute the sum of the first n terms of the following series
    S = 1+1/2+1/3+1/4+……
  1. Write a program to compute the sum of the first n terms of the following series
    S = 1-2+3-4+5……………
  1. Write a function that checks whether a given string is Palindrome or not. Use this function to find whether the string entered by user is Palindrome or not.
  1. Write a function to find whether a given no. is prime or not. Use the same to generate the prime numbers less than 100.
  1. Write a program to compute the factors of a given number.
  1. Write a macro that swaps two numbers. Write a program to use it.
  1. Write a program to print a triangle of stars as follows (take number of lines from user):
        *
       ***
      *****
     *******
    *********
  1. Write a program to perform following actions on an array entered by the user:
  • Print the even-valued elements
  • Print the odd-valued elements
  • Calculate and print the sum and average of the elements of array
  • Print the maximum and minimum element of array
  • Remove the duplicates from the array
  • Print the array in reverse order
    The program should present a menu to the user and ask for one of the options. The menu should also include options to re-enter array and to quit the program.

  • Click me to Navigate to the file

  1. Write a program that prints a table indicating the number of occurrences of each alphabet in the text entered as command line arguments.
  1. Write a program that swaps two numbers using pointers.
  1. Write a program in which a function is passed address of two variables and then alter its contents.
  1. Write a program which takes the radius of a circle as input from the user, passes it to another function that computes the area and the circumference of the circle and displays the value of area and circumference from the main() function.
  1. Write a program to find sum of n elements entered by the user. To write this program, allocate memory dynamically using malloc() / calloc() functions or new operator.
  1. Write a menu driven program to perform following operations on strings:
  • Show address of each character in string
  • Concatenate two strings without using strcat function.
  • Concatenate two strings using strcat function.
  • Compare two strings
  • Calculate length of the string (use pointers)
  • Convert all lowercase characters to uppercase
  • Convert all uppercase characters to lowercase
  • Calculate number of vowels
  • Reverse the string

  • Click me to Navigate to the file

  1. Given two ordered arrays of integers, write a program to merge the two-arrays to get an ordered array.
  1. Write a program to display Fibonacci series (i) using recursion, (ii) using iteration
  1. Write a program to calculate Factorial of a number (i) using recursion, (ii) using iteration
  1. Write a program to calculate GCD of two numbers (i) with recursion (ii) without recursion.
  1. Create Matrix class using templates. Write a menu-driven program to perform following Matrix operations (2-D array implementation): i) Sum ii) Difference iii) Product iv) Transpose
  1. Create the Person class. Create some objects of this class (by taking information from the user). Inherit the class Person to create two classes Teacher and Student class. Maintain the respective information in the classes and create, display and delete objects of these two classes (Use Runtime Polymorphism).
  1. Create a class Triangle. Include overloaded functions for calculating area. Overload assignment operator and equality operator.
  1. Create a class Box containing length, breath and height. Include following methods in it:
  • Calculate surface Area
  • Calculate Volume
  • Increment, Overload ++ operator (both prefix & postfix)
  • Decrement, Overload -- operator (both prefix & postfix)
  • Overload operator == (to check equality of two boxes), as a friend function
  • Overload Assignment operator
  • Check if it is a Cube or cuboid
    Write a program which takes input from the user for length, breath and height to test the above class.

  • Click me to Navigate to the file

  1. Create a structure Student containing fields for Roll No., Name, Class, Year and Total Marks. Create 10 students and store them in a file.
  1. Write a program to retrieve the student information from file created in previous question and print it in following format: Roll No. Name Marks
  1. Copy the contents of one text file to another file, after removing all whitespaces.
  1. Write a function that reverses the elements of an array in place. The function must accept only one pointer value and return void.
  1. Write a program that will read 10 integers from user and store them in an array. Implement array using pointers. The program will print the array elements in ascending and descending order.