answersLogoWhite

0


Best Answer

#include<stdio.h> #include<conio.h> void main() { int a[5],i; int ele,temp=0,pos=0; clrscr(); printf("enter the array elements\n"); for (i=0; i<5; i++) scanf("%d",&a[i]); printf("Enter the element to be search\n"); scanf("%d",&ele); // searching for the element for (i=0; i<5; i++) { if (a[i]==ele) { temp=1; pos=i; } } if (temp==1) printf("Element found %d , position==%d",ele,pos); else printf("Element not found\n"); } // end of main()

Any Doubts Dharma....(dharma548@gmail.com)

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program for How do you find the missing number in sequential array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

The time complexity of the sequential search algorithm is?

O(N) where N is the number of elements in the array you are searching.So it has linear complexity.


Can you use a sequential search on an unsorted array?

Sequential search is the only way to search an unsorted array unless you resort to a multi-threaded parallel search where all threads concurrently search a portion of the array sequentially.


Program to print all the even numbers of an array in visual basic?

find even number in array


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


In Computer programming Why is it considered good programming practice to define the number of array items as a constant before declaring the array?

In computer programming, (1) When a number is needed several times in a program, it is good practice to give that number a name. (2) When a name refers to a number that will never change during a run of a program, it is good practice to declare it as a constant before using it. In most programming languages, we do not define the number of array items as a constant. In many programming languages, it is easy to add items to an array, and an array keeps track of the number of items it holds, which a program can access using something like "array.length" or "array.shape". However, in C and C++ programming, the programmer must define the size of the array at the time it is defined, and the array does not keep track of the number of items it contains. To not define your array would leave the program open to unchecked growth. "Capping" the array with an upper value ensures that, if something goes wrong, you will not crash the application or system. Also, capping the array will make debugging potentially easier. Capping requires using that number in several places, and so (1) tells us it is good practice to give that number a name. Since it is not possible(*) to change the size of an array in C or C++, the number that holds the number of items in the array will never change, and so (2) tells us it is good practice to declare it as a constant. (*) There are a few tricks one can do with malloc() and realloc() that have the same effect as resizing an array, although technically all those tricks merely create a new fixed-size array.

Related questions

Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


The time complexity of the sequential search algorithm is?

O(N) where N is the number of elements in the array you are searching.So it has linear complexity.


Can you use a sequential search on an unsorted array?

Sequential search is the only way to search an unsorted array unless you resort to a multi-threaded parallel search where all threads concurrently search a portion of the array sequentially.


Program to print all the even numbers of an array in visual basic?

find even number in array


How can the content of the array be recorded to improve the average performance in sequential search of reordered?

If you're strictly using a sequential search, then the order of the array's content will make no difference. Whether it's in low-high order, high-low order, or randomized, the time complexity for a sequential search will remain O(n).


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


Explain linear search with an example?

Sequential search of an object with in an array of objects is called as linear search.


In Computer programming Why is it considered good programming practice to define the number of array items as a constant before declaring the array?

In computer programming, (1) When a number is needed several times in a program, it is good practice to give that number a name. (2) When a name refers to a number that will never change during a run of a program, it is good practice to declare it as a constant before using it. In most programming languages, we do not define the number of array items as a constant. In many programming languages, it is easy to add items to an array, and an array keeps track of the number of items it holds, which a program can access using something like "array.length" or "array.shape". However, in C and C++ programming, the programmer must define the size of the array at the time it is defined, and the array does not keep track of the number of items it contains. To not define your array would leave the program open to unchecked growth. "Capping" the array with an upper value ensures that, if something goes wrong, you will not crash the application or system. Also, capping the array will make debugging potentially easier. Capping requires using that number in several places, and so (1) tells us it is good practice to give that number a name. Since it is not possible(*) to change the size of an array in C or C++, the number that holds the number of items in the array will never change, and so (2) tells us it is good practice to declare it as a constant. (*) There are a few tricks one can do with malloc() and realloc() that have the same effect as resizing an array, although technically all those tricks merely create a new fixed-size array.


The integers from 1 to n are stored in an array in random fashion. One of the numbers is missing. What is an example of a program that will find the missing number?

1. Determine the sum of 1..n = (n(n+1))/2 2. Subtract all the elements in the given array (n-1 elements) from the expected sum. 3. The missing number is the value remaining. /* Implementation in "C" */ int MissingNumber(int values[], int n) { int total = (n * (n+1))/2; while (n&gt;1) { total -= values[n-2]; n--; } return total; }


How do you use in array?

cod a program student degree array in c language


How do you find missing numbers in a array with elements below its size?

Please rephrase your question. An array usually has a fixed size and I don't recall ever having to "go below its size". This implies that the missing elements are not within the range of the array.


What is squre array?

A square array is an array in which the number of rows is the same as the number of columns.