63 125
Assignments Done
Successfully Done
In July 2018

Answer to Question #58798 in C# for Lekorius Wallace

Question #58798
Write a program that asks the user to enter up to 20 integers.Store the integers in an array of longs. Then, the program should ask the user to enter an integer. The program should use the function Find_It()to locate the integer in the array. The third argument in Find_It() is the address of the found integer. The function should return 1 if the integer is found and 0 otherwise. If the integer is found, the program should replace the integer by its negative and display the elements in the array. If the integer is not found, display an appropriate message.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace array
class Program
static void Main(string[] args)
long[] array = new long[20];
for (int i = 0; i < 20; i++)
Console.WriteLine("Enter " +
(i+1) + " number of array");
array[i] = Convert.ToInt64(Console.ReadLine());
Console.WriteLine("Enter number that you want to find");
int numb = Convert.ToInt32(Console.ReadLine());
int result = 0;
if (Find_It(array, numb, ref result) == 0)
Console.WriteLine("There is not this number in array");
array[result] *= -1;
foreach (long n in array)

public static int Find_It(long[] mas, int a, ref int res)

for (int i = 0; i < mas.Length; i++)
if (a == mas[i])
res = i;
return 1;
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions