I lost my notes about this one and my classmates are really useless because they don't copy a damn simple code. My teacher said find it out and it's been my second day answering and still i cant find/solve/code it.

Make the user prompt 5 numbers, the 5 numbers passes through an array, then let the user prompt 1 number to be searched either its one of the 5 numbers or not. If the number is in the array it displays "Num. is in the Array", if not in array "Num. is not in the Array".

my codes that i'm been tackling:
Code:
```main()
{
int x,i,b,a[5];
clrscr();
g(1,1);
p("Enter 5 Numbers: ");
s("%d%d%d%d%d",&a[1],&a[2],&a[3],&a[4],&a[5]);
g(1,8);
p("Search Number: ");
s("%d",&b);
x=9;
for(i=1;i<6;i++)
{
if(a[i]==b)
{
g(22,x);
p("Number in Array");
x++;
}
else
{
g(22,x);
p("Number not in array");
x++;
}
}
getch();```
and i was sure that my teachers codes were 1/3 shorter than mines. when i try to run it, it also loops the "Number is in array" and " NUmber is not in array".

2. I don't understand the single letter on the far left side of several of your lines of code.

Code:
```for(i = 0, i < 5; i++)               //data entry
scanf("%d", &a[i];

printf("\nEnter the number to be searched for: ");
scanf("%d", &goal);

for(i = 0, found = 0; i < 5; i++)  {   // 0 through 4 is 5 numbers
if(goal == a[i])
printf("\nNumber %d was found", goal);
}```

3. btw... where will you place the "Number is not in Array" in your codes?

4. Originally Posted by jazzglenn421
codes?
Code (as in sourcecode) has no plural. It's only teenage imbeciles that write "Giz us teh codez"...

QuantumPete

5. Originally Posted by QuantumPete
Code (as in sourcecode) has no plural. It's only teenage imbeciles that write "Giz us teh codez"...

QuantumPete
Sorry, i'm just new to C ok?... i'm a total newbie all i know is playing online/offline games and i just took this subject cus its in my curriculum, i learned to love it and hope to be good at it. So please stay on topic.

6. Code:
```for(i = 0, i < 5; i++)               //data entry
scanf("%d", &a[i];

printf("\nEnter the number to be searched for: ");
scanf("%d", &goal);

for(i = 0, found = 0; i < 5; i++)  {   // 0 through 4 is 5 numbers
if(goal == a[i])  {
printf("\nNumber %d was found", goal);
found = 1;
}
}

if(!found)
printf("%d was not in the array", goal);```
I'm being a "giving tree" here for you, one time. Don't expect it with such little work on your part, next time. It won't happen.

You know you're behind the curve on this, so study up.