Help i need array+loop and count C++
Help i need array+loop and count C++
i need code for count the same value in array
Ex.
____________________________________________
Enter 10 #:1 2 3 4 4 4 4 4 4 5<---------------for array
Enter a Number: 4 <------------------entering the same for counting
Answer :6 <---------------------------- the Result
____________________________________________
this is my code:
#include <stdio.h>
int main()
{
int a[10],x,z;
printf("enter a number");
for(x=0;x<=9;x++)
{
scanf("%d" ,&a[x]);
}
for(x=0;x<=9;x++)
{
}
printf("enter a number");
scanf("%d" ,&z);
if(z==a[x])
z++;
printf("answer is %d" ,z);
{
}
}
plsss help me
i hope you can help Me !!!!!!!
i can`t run program perfectly
i can`t run program perfectly help me!!!
enter # 1 2 3 4 4 4 4 4 4 4
enter # 4
answer 5
i want count the same value in array
like this
enter # 1 2 3 4 4 4 4 4 4 4
enter # 4
answer 7
help me!!!