Skip to content

abhi5455/C-Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-Programming

KTU S2 C Lab

Cycle-1

  1. Find the roots of a quadratic equation in the form ax^2 + bx + c = 0. (if .. else)
  2. Input a month number and display the number of days in that month. (switch)
  3. Find the GCD and LCM of two numbers.
    (while / do ..while)
  4. Find the largest and smallest of a set of N numbers. (for)
  5. Input a binary number and display the decimal equivalent of that number. (while /do .. while)
  6. Display the first N prime numbers. (nested loop)
  7. Display the perfect numbers in first N counting numbers. (nested loop)

Cycle-2

  1. Search for a particular number in a list of N numbers using linear search. Display the position of the number in the list if the number is present. Otherwise display suit able message.
  2. Display the binary equivalent of an unsigned decimal integer. (using 1-D array)
  3. Sort N integers in ascending order using bubble sort algorithm.
  4. Search for a number in a sorted list of numbers using binary search.
  5. Given two sets (mathematical set) of numbers A and B. Find A U B, A ∩B, A-B.
  6. Given two sorted list of numbers. Merge these two lists to form a new list such that the resultant list is also in sorted order. (do the operation without further sorting).

Cycle-3

  1. Find the smallest element in a m x n matrix. Also display the position of this smallest element. {Position of the first occurrence of smallest element in the matrix}
  2. Find the sum of elements in each row, each column of a m x n matrix. Also find the sum of boundary elements the matrix.
  3. Check whether a given square matrix is symmetric. If not symmetric display the transpose of the matrix.
  4. Find the alphabet which is occurring highest number of times in a line of text. Also display its frequency.
  5. Input N student names and arrange them in alphabetical order using exchange sort.

Cycle-4

  1. Write a function for checking whether a positive integer number is prime or not. Using this function display the prime numbers in a mxn matrix.
  2. Write functions for evaluating sine(ɵ) and cosine(ɵ). Verify the values using library functions sin(ɵ) and cos(ɵ). {Convert degree into radians}
  3. Write a recursive function for finding factorial. Using this function find nCr.
  4. Write a function for checking whether a string is palindrome. Using this function display the palindrome words in a line of text.
  5. Write a recursive function for binary search. Using this function check whether a number is present in a list of numbers arranged in descending order.
  6. Write a program for finding the product of two matrices. Write separate functions for Reading matrices, Multiplication of matrices and Display matrix.
  7. Write a function for finding the largest number in a one dimensional array. Using this function display the largest element in each row of a mxn matrix.

Cycle-5

  1. Store the regno, name and 4 marks of a set of students in an array of structure and display the details along with total marks in the descending order of total marks.
  2. Define an array of structure for storing the coefficients and exponents of a polynomial. Write a program for adding two polynomials.
    {Hint :- Input number of terms of each polygons before reading. Input the terms of a polynomial in the decreasing order of exponents. Ex : 7x5 +8x2 -10}
  3. Define a structure for storing a complex number. Write functions for finding the sum, difference and product of two complex numbers. Input two complex numbers and display their sum, difference and product using the above functions.
  4. Implement the following string library functions using pointers:
    1. string length [int StringLengh(char *s)]
    2. string copy [void StringCopy(char *s1, char *s2) ]
    3. string comparison [int StringCompare (char *s1, char *s2) ]
    4. string concatenation [void StringConcat(char *s1, char *s2) ]
  5. Write a program to find the smallest number in a list of integers using command line argument.

Releases

No releases published

Packages

No packages published

Languages