Skip to content

Saee02/Linear-Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Linear-Search

Here is a C program that looks up a number in an array of integers. The array is initialized with 6 values: 2, 9, 10, 15, 3, and 10. The user is prompted to enter a number to search for. This number is read into an integer variable search using the scanf function. The program then uses a for loop to iterate through the array, checking each element to see if it matches the search value. If a match is found, the integer variable's counter is set to 1. After the for loop, the program checks the value of count. If count is 1, it means the search value was found in the array, and the program prints the message "That number exists." If count is 0, it means the search value was not found in the array and the program displays the message "number does not exist".

image

linear search

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages