Horje
search array element in c Code Example
search array element in c
#include <stdio.h>

int main()
{
    int ara[10]={1,2,3,4,5,6,7,8,9,10};
    int i,is_found=-1,search_value;
    printf("Enter search value:\n");
    scanf("%d",&search_value);
    for(i=0;i<10;i++){
        if(ara[i]==search_value){
            is_found=i;
        }
    }
    
    if(is_found==-1){
        printf("Item not found\n");
        
    }else{
        printf("Item found at index on. %d\n",is_found);
    }

    return 0;
}




C

Related
what is covert channel Code Example what is covert channel Code Example
how to sleep in c Code Example how to sleep in c Code Example
golang loop through array Code Example golang loop through array Code Example
hi servicenow Code Example hi servicenow Code Example
get current used proxy windows 7 Code Example get current used proxy windows 7 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8