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

What command would you use to create a backup control file?

Answer

Alter database backup control file to trace

Report Error

View answer Workspace Report Error Discuss

3 2667
Q:

A VM/VSE customer wants to implement a WAS on an existing zSeries server. On which of the following operating environments would WAS best be implemented?

A) VSE B) z/VM
C) z/OS D) Linux
 
Answer & Explanation Answer: D) Linux

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: IBM Certification

1 2666
Q:

Fire temple is the place of worship of which religion?

A) Shintoism B) Zoroastrianism
C) Taoism D) Judaism
 
Answer & Explanation Answer: B) Zoroastrianism

Explanation:

Fire temple is the place of worship of Zoroastrianism (Parsi Religion).

 
Report Error

View Answer Report Error Discuss

Filed Under: Indian Culture
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

22 2665
Q:

Improve the bracketed part of the sentence.
The student of human history can draw on many more natural experiments (than) just comparisons among the five inhabited continents.

A) to B) of
C) for D) no improvement
 
Answer & Explanation Answer: D) no improvement

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English

0 2665
Q:

The commercial and marketing arm of ISRO is

A) Antrix Corporation Limited B) ISRO Satelliet Corporation
C) Space Applications Center D) None
 
Answer & Explanation Answer: A) Antrix Corporation Limited

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: CAT , Bank Exams
Job Role: Bank PO , Analyst

8 2665
Q:

A protein that acts as a hormone is

A) Estrogen B) Insulin
C) Both A & B D) None of the above
 
Answer & Explanation Answer: B) Insulin

Explanation:

A protein that acts as a hormone is INSULIN.

a_protein_that_acts_as_a_hormone_is1534420157.jpg image

Insulin is a peptide hormone produced by beta cells of the pancreatic islets; it is considered to be the main anabolic hormone of the body.  Insulin helps keeps your blood sugar level from getting too high or too low.  

Report Error

View Answer Report Error Discuss

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

2 2665
Q:

Wind and solar energy are examples of

A) Finite energies B) Renewable energies
C) Non renewable energies D) None of the above
 
Answer & Explanation Answer: B) Renewable energies

Explanation:

Wind and solar energy are examples of Renewable energies. 

 

Renewable energy sources are those which can be naturally replenished. 

wind_and_solar_energy_are_examples_of1535692456.jpg image

Report Error

View Answer Report Error Discuss

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

0 2665