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 2304
Q:

The Solar System was discoverd by

A) Galleleo B) Finsen
C) Copernicus D) None of these
 
Answer & Explanation Answer: C) Copernicus

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Inventions

0 2304
Q:

Which of the following range is known as 'Sahyadri'?

 

A) Satpura B) Western Ghats
C) Eastern Ghats D) Aravali
 
Answer & Explanation Answer: B) Western Ghats

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: Bank Exams

0 2303
Q:

How many pints of blood in the human body?

A) 6 - 8 B) 10 - 12
C) 8 - 10 D) 5 - 7
 
Answer & Explanation Answer: B) 10 - 12

Explanation:

Scientists estimate the volume of blood in a human body to be approximately 7 percent of body weight. An average adult body with a weight of 150 to 180 pounds will contain approximately 4.7 to 5.5 liters of blood. An average child with a body weight of 80 pounds will have approximately half the amount of blood as an adult.

The amount of blood in a human body varies, depending on factors such as age, sex, overall health and even where a person lives. For example, men tend to have more blood than women of comparable size and weight.

Interestingly, people who live at high altitudes may have up to two liters of extra blood compared to those who live at lower altitudes. Because the air at higher altitudes has less oxygen, people who live at high altitudes need extra blood to deliver the right amount of oxygen to their lungs.

 

We know that 1 Pint = 0.473 liters

 

Hence, an average amount of blood in the human body = 4.7 - 5.5 lit = 10 - 12 pints.

Report Error

View Answer Report Error Discuss

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

4 2302
Q:

What is the usual colour of Aircraft data recorder "Black box" ?

A) Black B) Orange
C) Blue D) Greeen
 
Answer & Explanation Answer: B) Orange

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

4 2301
Q:

Which phase change is an example of an exothermic process?

A) Liquid to Solid B) Gas to Solid
C) Gas to Liquid D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

Processes that require or give off heat will be limited to changes of state, known as phase changes, and changes in chemical constitution, or chemical reactions. Changes of state involve a solid melting, a liquid freezing, a liquid boiling or a gas condensing.

 

An exothermic process is one that gives off heat, which is transferred to the surroundings. An endothermic process is a reaction which heat has to be supplied to the system from the surroundings.

 

Here in all the given options, heat is taken away from them to change there phase. 

Liquid to Solid --- Freezing

Gas to Liquid --- Condensation

Gas to Solid --- Deposition 

are all examples of exothermic processes.

 

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO , IT Trainer

6 2301
Q:

The popular Access Method for computer network is

A) Ethernet B) Token Ring
C) Bus Token D) None
 
Answer & Explanation Answer: B) Token Ring

Explanation:
Report Error

View Answer Report Error Discuss

14 2299
Q:

I can shave everyday but my beard will stay. who am I?

Answer

I am a Barber.

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles Exam Prep: Bank Exams

27 2299