TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mngaro Mwazenje
NA
80
13.1k
search array n give index
Mar 2 2020 5:22 AM
using
System;
using
System.Collections.Generic;
namespace
exercise_79
{
class
Program
{
public
static
void
Main(
string
[] args)
{
// DO NOT CHANGE THE FOLLOWING CODE!
int
[] array =
new
int
[10];
array[0] = 6;
array[1] = 2;
array[2] = 8;
array[3] = 1;
array[4] = 3;
array[5] = 0;
array[6] = 9;
array[7] = 7;
Console.WriteLine(
"Search for?"
);
int
searching = Convert.ToInt32(Console.ReadLine());
// Implement the search functionality here
}
}
}
The exercise template has already an array containing numbers. Complete the program to ask the user for a number to search in the array. If the array contains the given number, the program tells the index containing the number. If the array doesn't contain the given number, the program will tell the number wasn't found.
Reply
Answers (
4
)
swap arrays given by the user
Upload different different image.