Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
linear search
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here int [] a= new int[5]; int i,s; Console.WriteLine("Enter 5 elelements!"); for(i=0;i<a.Length;i++) { a[i]= Int32.Parse(Console.ReadLine()); } Console.WriteLine("enter search element"); s= Int32.Parse(Console.ReadLine()); for(i=0;i<a.Length;i++) { if(a[i]==s) { Console.WriteLine("no was found"); break; } } if(i==5) { Console.WriteLine("no was not found"); } Console.ReadKey(); } } }
run
|
edit
|
history
|
help
0
6.4 Parallelism: threads and events
asdfghyjujn dsc
1
AX 2012 Test #1
Lambda Expressions Are Cool 2
k
hivix
30272 ProgramEX8 For&While
Regex - Leading zeros
saved