|
#1
| ||||
| ||||
![]() #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(); } |
![]() |
Tags |
array, find, number, program |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
| |
![]() | ||||
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 |