Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want you to solve part b .You also need to search a number whether the number is inside the array or not in part

I want you to solve part b .You also need to search a number whether the number is inside the array or not in part b.image text in transcribed

a. Write a C program that finds an element in an array of 10 numbers. First create an array of 10 elements and initialize it with integer random numbers between 1 and 100 in your program. Then ask user to enter a number and search this number in the array you have created. Display a message to the user indicating whether the number is in the array or not. Use a function called linear_search that you used in Worksheet 7 part d. A sample run for this array (1,7, 9, 4, 90, 56, 2, A sample run for this array (1,7,9,4, 90, 56, 2, 100, 100, 5, 10) would be as follows: 5, 10] would be as follows: Enter a number to search: 5 Enter a number to search: 48 Number 5 is in the array! Number 48 is not in the array! b. Modify your program in part (a) such that the user enters the numbers that will be populated to the array. A sample run would be as follows: A sample run would be as follows: Enter number 1 to populate: 2 Enter number 1 to populate: 2 Enter number 2 to populate: 65 Enter number 2 to populate: 85 Enter number 3 to populate: 9 Enter number 3 to populate: 9 Enter number 4 to populate: 78 Enter number 4 to populate: 15

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions