Questions

Q:

Write a c program for binary search.

Answer

#include<stdio.h>
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<n;i++){
         scanf("%d",&a[i]);
    }

    printf("Enter the number to be search: ");
    scanf("%d",&m);

    l=0,u=n-1;
    while(l<=u){
         mid=(l+u)/2;
         if(m==a[mid]){
             c=1;
             break;
         }
         else if(m<a[mid]){
             u=mid-1;
         }
         else
             l=mid+1;
    }
    if(c==0)
         printf("The number is not found.");
    else
         printf("The number is found.");

    return 0;
}

Sample output:
Enter the size of an array: 5
Enter the elements in ascending order: 4 7 8 11 21
Enter the number to be search: 11
The number is found.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2768
Q:

Bleeding of gums, falling of teeth, fragile bones and delayed wound healing occur due to the deficiency of which one of the following vitamins?

A) Vitamin C B) Vitamin K
C) Vitamin D D) Vitamin B
 
Answer & Explanation Answer: A) Vitamin C

Explanation:

Deficiency of Vitamin C causes Scurvy, Swelling of gums etc.Vitamin K causes Non-clotting of blood ,Vitamin D causes Rickets in children and Osteomalasia in adults, Vitamin B 1 causes Beriberi,B2 causes Cracking of skin,reddish eye,cracking of tongue,B3 causes Whitening of hair ,mentally retardness ,B5 causes Pallagra or 4D syndrome,B6 causes Anemia,skin disease ,B7 causes Paralysis,hair falling,B11 causes Dysentery and B12 causes Jaundice and Teroile Glutemi

Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: Bank Exams

1 2767
Q:

A feature of catabolic reactions is that they

A) occur only in mitochondria B) occur only during loss of body weight
C) involve release of energy D) involve consumption of energy
 
Answer & Explanation Answer: C) involve release of energy

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk

5 2767
Q:

What is virtual channel?

Answer

Virtual channel is normally a connection from one source to one destination, although multicast connections are also permitted. The other name for virtual channel is virtual circuit.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

0 2766
Q:

Do plant cells have Mitochondria?

A) No B) Yes
C) May be D) Can't be determined
 
Answer & Explanation Answer: B) Yes

Explanation:

While plant cells have chloroplasts to photosynthesize, they also require ATP for cellular functions, and do use oxygen to break down some of the sugar they produce in order to generate that ATP. Cellular respiration takes place in the mitochondria. They need mitochondria for this reason.
Hence with this logic, we can say that Plants cells have mitochondria.

Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk , Bank PO

2 2765
Q:

The talk test can be used to measure the

A) Speech frequency B) Exercise intensity
C) Loudness intensity D) None of the above
 
Answer & Explanation Answer: B) Exercise intensity

Explanation:

The talk test can be used to measure the Exercise intensity.

Report Error

View Answer Report Error Discuss

Filed Under: General Science
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 2765
Q:

Which one of the following is the highest altitude zoo in the world?

A) Cheyenne Mountain Zoo B) Pandit G. B. Pant High Altitude Zoo
C) Himalayan Zoological park, Gangtok D) Padmaja Naidu Himalayan Zoological Park
 
Answer & Explanation Answer: D) Padmaja Naidu Himalayan Zoological Park

Explanation:

Cheyenne Mountain Zoo  -  6,800 feet

Himalayan Zoological Park, Gangtok  -  5839.895 feet

Padmaja Naidu Himalayan Zoological Park  -  7000 feet

 

Report Error

View Answer Report Error Discuss

Filed Under: Longest, Shortest, Deepest
Exam Prep: Bank Exams

3 2765
Q:

Who wrote the first history book?

A) Herodotus B) Euclid
C) Julius Caesar D) Aristotle
 
Answer & Explanation Answer: A) Herodotus

Explanation:

Herodotus, a Greek author written the first history book in 5th century B.C.

Report Error

View Answer Report Error Discuss

Filed Under: World History
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk , Bank PO

0 2764