Write a program to search an integer from and array of 50 elements. Print message that the integer Found or Not Found.
Answer / Niharika Nandan
Here is a sample program in Python for searching an integer within an array of 50 elements:
```python
def find_integer(arr, target):
found = False
for num in arr:
if num == target:
print(f'{target} found!')
found = True
break
if not found:
print(f'{target} not found!')
# Example usage:
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]
target = 23
find_integer(numbers, target)
| Is This Answer Correct ? | 0 Yes | 0 No |
WHAT VISA YOU ARE APPLING FOR
what are the reasons for the differnce in closing stock value before and after stock taking? ( value after stock taking is showing 2 lakhs higher)
Doing an MBA thru Distance Education which University is best 1.Anna University-Chennai (or)2.Bharathidasan University-Trichy.
what is means of sap
why do u select to do MBA in HR after doing B.Sc in physics?
Discuss the nature and types of secondary data sources. Also discuss the data research procedure.
How Are Changing Laws And Technology Impacting Storage For Small Businesses?
what is the full form of EMP?
why you want to join private company?
Explain the meaning and discuss the importance of motivation in a teamwork context
what is management?
What is the scope of MBA (International Business). Basically I am B.sc (Chemistry). I have finished MBA(IB) 2010. Anybody please guide me to improve my career.
Business Administration (517)
Marketing Sales (1279)
Banking Finance (3208)
Human Resources (747)
Personnel Management (68)
Hotel Management (29)
Industrial Management (113)
Infrastructure Management (14)
IT Management (97)
Supply Chain Management (16)
Operations Management (39)
Funding (79)
Insurance (494)
Waste Management (1)
Labor Management (48)
Non Technical (73)
Business Management AllOther (546)