HOME BZU Mail Box Online Games Radio and TV Live Cricket Score All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Institute of Computing Bachelor of Science in Information Technology BsIT 1st semester Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 1.00 average. Display Modes
  #1  
Old 06-05-2011, 10:32 PM
JuNaiDiQbaL's Avatar
Never Give Up

 

Join Date: Jan 2011
Location: SahiwaL
Age: 28
Posts: 26
Program / Discipline: BSIT
Class Roll Number: 10-26
JuNaiDiQbaL has a spectacular aura aboutJuNaiDiQbaL has a spectacular aura about
Default A Program to find number in an array


#include<iostream.h>
#include<conio.h>
void main()
{
int a[10]={1,5,8,9,4,6,0,3,7,2};
int i,n,index=-1;
cout<<"enter any no";
cin>>n;
for(i=0;i<=9;i++)
{
if(a[i]==n)
index=i;
}
if(index==-1)
cout<<"number not found";
else
cout<<"number found at index "<<index;
getch();
}
Reply With Quote
Reply

Tags
array, find, number, program


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program to find a greater digit in a four digit number. JuNaiDiQbaL Object Oriented Programming 0 08-05-2011 11:12 PM
Program to enter 10 integers in a single-dimension array and then print out the array in ascending order bonfire Object Oriented Programming 0 09-03-2011 12:23 AM
Program to find the Sum of all elements in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:00 PM
Program to find the Minimum Number in an Array .BZU. Visual Programming 0 15-12-2009 10:57 PM
Program to find the Maximum Number in an Array (By Sheraz) .BZU. Visual Programming 0 15-12-2009 09:16 PM

Best view in Firefox
Almuslimeen.info | Cloud Computing | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 07:58 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.