Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  value_find
Language: C/C++
Code:
#include <stdio.h>
int search(int arr[],int s_val)
{
     int i;
     for(i=0;i<10;i++)
        if(arr[i]==s_val)
           return 1;
return 0;
}
int main()
{
int arr[10]={1,2,3,4,5,6,7,8,9,0},s_num;
printf("enter the value of n do you want to search :");
scanf("%d",&s_num);
if(search(arr,s_num))
     printf("found");
else
     printf("not found");
return 0;
}
          
          
          
          
          
          
          
          
Comments: