×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
enumerated data type in C Language - MAKAUT / WBUT MCA 2011 Sum of its Individual Digits Repeatedly - MAKAUT / WBUT MCA 2011
Binary Searching using C - MAKAUT / WBUT MCA 2011 - C Language
972    Arnab De    16/12/2019

Write a C-program to implement binary searching. [WBUT MCA 2011]

For binary search, we have to take an array which is sorted in asending order. If given array is not sorted, then we have to sort it by any sorting technique. After then binary search is possible. It is faster than lenear searching.

softetechnologies
#include 

int main()
{
    int a[]={10,15,17,20,28,32,40,41,89};
    int found,fl=0,min=0,max=8,mid;
    printf("Enter a number for search : ");
    scanf("%d",&found);
    
    while(minfound)
        {
            max--;
        }
        else
        {
            min++;
        }
    }
    if(fl)
    {
        printf("%d is found",found);
    }
    else
    {
        printf("%d is not found",found);
    }

    return 0;
}
softetechnologies

Output:
Enter a number for search : 28
28 is found

enumerated data type in C Language - MAKAUT / WBUT MCA 2011 Sum of its Individual Digits Repeatedly - MAKAUT / WBUT MCA 2011
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Sri Sri Ramakrishna Paramahamsa
God is in all men, but all men are not in God; that is why we suffer.
Sri Sri Ramakrishna Paramahamsa
4295
40.91
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     34530
26/05/2018     32724
28/06/2017     31338
02/08/2017     29642
25/06/2018     27478
15/05/2017     24907
01/08/2017     24107
06/07/2017     23632
21/04/2018     19454
14/07/2017     19142
softetechnologies