Skip to content

This Repository contains basic programs in C programming language

License

Notifications You must be signed in to change notification settings

Eyantra698Sumanto/Basic-C-Programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Basic-C-Programs

Arrays

  1. To search an element in an array using i. Linear Search ii. Binary Search.
  2. To sort array in ascending/descending order
  3. To find transpose of a matrix without using another matrix
  4. To find transpose of a matrix with using another matrix
  5. To print array in reverse using pointers and function (Expt 23)
  6. To print pascal triangle (program should ask no of lines to user) 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
  7. WAP to check whether entered matrix is symmetric or not
  8. To find norm of a square matrix
  9. To find trace of a square matrix
  10. Write a program to perform addition of two matrices using user defined functions: a. read_matrix() b. print_matrix() c. add_matrix() b. Print all three matrices.

Strings

  1. WAP to count no of vowels, consonants, digits, spaces and special characters in entered string
  2. WAP to check whether entered string is palindrome or not
  3. WAP using user defined functions xstrlen, xstrcmp, xstrcpy, xstrcat, xstrev. Use switch case.

Structure
14. Create a structure Patient having patientID , Name and diseases as data members. Read details of 5 patients and print details of the patients with a disease ‘diabetes’.

  1. Create a structure Employee with data members’ employee ID, name and salary. Write a program to sort 10 employees according to their salary (in descending order).
  2. WAP to print names of students in ascending order of their average marks using structure student. Student structure contains following elements: Roll No, Name, marks of 3 subjects (array of int size 3), avg_marks
  3. To create a structure having following elements: i. Employee code ii. Employee name iii. Employee salary iv. Employee date_of_joining WAP to read at least 10 records and display them using nested structure.
  4. Define a structure “Hockey” consisting of following elements: i. Player name ii. Name of the country iii. Number of matches played iv. Number of goals scored

WAP to read records of N players and to prepare following lists: i) List prepared according to players’name ii) List prepared according to country’s name iii) List prepared according to number of matches played iv) List prepared according to number of goals scored 19. Tutorial 9 question no 2

  1. WAP to add two rational numbers using structure
  2. WAP to add two complex numbers using structure
  3. WAP to find distance of two points using structure Functions
  4. Write recursive function i. To compute factorial of a number ii. To compute xn iii. To computer gcd of two numbers using Euclid’s algorithm iv. To add two numbers v. To multiply two numbers vi. To add first n natural nos vii. To add array elements of array size n viii. To print binary equivalent of a number ix. To print first n terms of Fibonacci series
  5. WAP using functions and switch-case to i. Decide whether entered no is odd and even. ii. Entered year is leap or not iii. Maximum of 3 nos using ternary operator iv. Swap two nos. v. To find area and perimeter of a circle given radius vi. To find area and perimeter of a rectangle given length and breadth vii. To find nPr and nCr using fact function
  6. WAP to find standard deviation of n numbers inputted by user using function find_mean() , find_variance().