logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Write a c program for binary search.


  • Correct Answer
  • #include int main(){ int a[10],i,n,m,c=0,l,u,mid; printf("Enter the size of an array: "); scanf("%d",&n); printf("Enter the elements in ascending order: "); for(i=0;i


  • Programming problems


    Search Results


    • 1. Write a c program for merge sort.
    • Discuss
    • 2. Write a c program for insertion sort.
    • Discuss
    • 3. Write a c program for quick sort.
    • Discuss
    • 4. Write a c program for selection sort.
    • Discuss
    • 5. Write a c program to print multiplication table
    • Discuss
    • 6. Write a program for matrix multiplication in c
    • Discuss
    • 7. Write a c program to copy a data of file to other file.
    • Discuss
    • 8. What will be output of following c code? void main() { struct india { char c; float d; }; struct world { int a[3]; char b; struct india orissa; }; struct world st ={{1,2,3},'P','q',1.4}; clrscr(); printf("%dt%ct%ct%f",st.a[1],st.b,st.orissa.c,st.orissa.d); getch(); }
    • Discuss
    • 9. What is the output of this C code? #include void m() { printf("hi"); } void main() { m(); }

    • Options
    • A. hi
    • B. Run time error
    • C. None
    • D. Varies
    • Discuss
    • 10. The output of the code below is #include int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }

    • Options
    • A. 5
    • B. Junk value
    • C. 0
    • D. Error
    • Discuss


    Comments

    There are no comments.

Enter a new Comment