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.Rearrage 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 ina 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).


Popular posts from this blog

KTU C programming question paper and evaluation scheme

PART A 1 An identifier is a sequence of characters invented by the programmer or to identify or name a specific object. The sequence of characters may be letters, digits, and special character ‘_’known as an underscore Rules: i)Identifiers should start with alphabets. ii)Identifiers are case sensitive iii)A numeric digit should not be the first character iv)Identifier name should not be a keyword v)Identifier may be of any reasonable length 1mark

2mark 2 Associativity defines the direction, left to right or right to left in which operator act upon its operands Unary operators have associativity is from right to left. For examplein the expression &--x, pre decrement works first and then address of operator works Direction + example<

Files in C

A file is a repository of data that is stored in a permanent storage media, mainly in secondary memory. In order to use the files we should learn how to read information from a file and how to write information into a file. A very important concept in C is the stream.The stream is a common logical interface to the various devices( files).A stream is linked to a file while using an open operation. A stream is disassociated from a file while using a close operation. The current location, also referred to as the current position, is the location in a file where the next fie access will occur.There are two types of streams text and binary. The following are some difference between text and binary files ·Text file is human readable because everything is stored in terms of text. In binary file everything is written in terms of 0 and 1, therefore binary file is not human readable. ·A newline(\n) character is converted into the carriage return-linefeed combination before being written to the d…

Linear and Binary Search in C

Searching is one of the most common problems that arise in computing. Searching is the algorithmic process of finding a particular item in a collection of items. A search typically answers either True or False as to whether the item is present. On occasion it may be modified to return where the item is found. Search operations are usually carried out on a key field. Consider searching for a given value k in an array A of size n. There are 2 basic approaches: sequential search and binary search.
Linear (Sequential) Search When data items are stored in a collection such as a list or array , we say that they have a linear or sequential relationship. Each data item is stored in a position relative to the others. In C array, these relative positions are the index values of the individual items. Since these index values are ordered, it is possible for us to visit them in sequence. This process gives rise to our first searching technique, the sequential search. Starting at the first item in …