C++ :
- main()
- {
- int key ;
- false = bool c;
- cin>>key;
- int i = 1 ;
- while ( i<= n && C = false )
- {
- if ( ar[i] == key ) { c = true ; }
- i+=1 ;
- }
- if ( c == true ) { cout<<"found"; }
- if ( c== false ) { cout<<" not found"; }
- system("pause");
- }
VB.net
dim c as boolean = false
dim i as integer = 1 ;
dim key as integer
inputbox( key )
while ( i<= n and c = false )
if ar(i) = key then
c = true
end while
if c = true then msgbox ("found")
if c = false then msgbox ( "not found")