Skip to main content

Programs to try using 1D-Array

1.Read an array and rotate elements right( read n-number of times to rotate).
2.Find the average of list of numbers.
3.Find the maximum and minimum values from an array of integers.
4.Swap the k th and k+1 th element in an array. Read k.
5.Find the binary equivalent of a number using array.
6.Find similar elements in an array and compute the number of times they occur.
7. Separate odd and even integers in separate arrays from a given array.
8.Find the intersection of two set of numbers.
9.Rearrange n numbers in an array in reverse order.(selection sort)
10.Sort the numbers stored in array in ascending order.(bubble sort)
11.Arrange numbers in an array in such a way that the array will have odd numbers followed by the even numbers.
12.Find the frequency of digits in a set of numbers.
13.Remove duplicate elements from an array.
14.Merge two sorted arrays into another array in sorted order.
15.Find the standard deviation of set of integer data.
16.Read list of numbers and print prime numbers from the list.
17.List of internal marks of a subject is stored in an array ( marks out of 50).Find
a.number of passed students ( need 50 percentage or more)
b.number of failed students
c.number of students having 60 percentage or more
d.maximum , minimum and average mark in the subject.
( do it as a menu driven program..)
18.Search a key element in a given array ( linear search)
19.Search a key element in the give sorted array ( binary search)
20.Generate Fibonacci numbers up to n and store it in an array.Read and print prime numbers from it.
21.Given two vectors V1 and V2. Find their dot product.
22.Given two vectors V1,V2 find V1-2V2
23.Find the length of a given vector.
24.Check whether two vectors are orthogonal.
25.Find the coordinates of vector AB, if A(1; 4; 5), B(3; 1; 1).
26.Find the second largest element in an unsorted array.
27.Find the kth largest element in a list.
28.Merge two sorted arrays.

Comments

Popular posts from this blog

KTU Mandatory C programs for Laboratory and Solutions

LIST OF LAB EXPERIMENTS 1. Familiarization of Hardware Components of a Computer 2. Familiarization of Linux environment – Programming in C with Linux 3. Familiarization of console I/O and operators in C     i) Display “Hello World”     ii) Read two numbers, add them and display their sum     iii) Read the radius of a circle, calculate its area and display it 4. Evaluate the arithmetic expression ((a -b / c * d + e) * (f +g))   and display its solution. Read the values of the variables from the user through console 5. Read 3 integer values, find the largest among them. 6. Read a Natural Number and check whether the number is prime or not 7. Read a Natural Number and check whether the number is Armstrong or not 8. Read n integers, store them in an array and find their sum and average 9. Read n integers, store them in an array and search for an element in the    array using an algorithm for Linear Search 10.Read n integers, store them in an array and sort the elements in t

PROGRAMMING IN C KTU EST 102 THEORY AND LAB NOTES

PROGRAMMING IN C  KTU  EST 102  THEORY AND LAB   COMMON FOR ALL BRANCHES About Me Syllabus Theory Syllabus Lab Model Question Paper EST 102 Programmin in C University Question Papers  and evaluation scheme   EST 102 Programming in C  Introduction( Lab) Introduction to C programming Linux History and GNU How to create a bootable ubuntu USB stick Installing  Linux Install Linux within  Windows Virtual Box and WSL Linux Basic Features and Architecture Basic Linux Commands Beginning C Programming Compiling C programs using gcc in Linux Debugging C program using gdb Module 1: Basics of computer hardware and software          Module-1 Reading Material Basics of Computer Architecture Hardware and Software System Software and Application Software  Programming Languages ( High level, Low level and Machine Language) and Translators ( Compiler, Interpreter, Assembler) Algorithm, Flowcharts and Pseudo code Program Development Structured Programming Basics of hardware ( video) Know about Motherboar

Arrays in C-single and multi dimensional arrays- list and matrix

An array is a collection of data items, all of the same type, accessed using a common name. A one-dimensional array is like a list(vector); A two dimensional array is like a table(matrix). We can have more dimensions. Always, Contiguous (adjacent) memory locations are used to store array elements in memory. Elements of the array can be randomly accessed since we can calculate the address of each element of the array with the given base address and the size of the data element. Declaring  Single Dimensional Arrays Array variables are declared identically to variables of their data type, except that the variable name is followed by one pair of square [ ] brackets for mentioning dimension of the array.  Dimensions used when declaring arrays in C must be positive integral constants or constant expressions.  In C99, dimensions must still be positive integers, but variables can be used, so long as the variable has a positive value at the time the array is declared. ( Space is allo