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:

Which statements about viruses are true?

A) HIV contains reverse transcriptase. B) A retrovirus contains RNA.
C) Both A & B D) All RNA-containing viruses are retroviruses.
 
Answer & Explanation Answer: C) Both A & B

Explanation:

The statements true about viruses are :

 

1. The capsid enters the host cell if the virus is enveloped.

2. Enveloped viruses bud from the host cell. 

3. HIV contains reverse transcriptase.

4. A retrovirus contains RNA.

Report Error

View Answer Report Error Discuss

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

1 2768
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 2767
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:

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

A weathering process in which layers of rocks peel off as expansion alternates with contraction , is known as ___

A) Shattering B) Block seperation
C) Granular disintegration D) Exfoliation
 
Answer & Explanation Answer: D) Exfoliation

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

0 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:

The given sentences, when properly sequenced, form a coherent paragraph. Each sentence is labelled with a letter. Choose the most logical order of the sentences from among the five given choices to construct a coherent paragraph keeping 1 as the first statement.

1) In Hindu mythology, when Shiva opens his third eye, it is considered a terrible warning for the cosmos.

A) In somewhat similar fashion, in 2017, women across the world seemed to declare war — on harassment, abuse, rape, inequality and every form of injustice.

B) Anger, however, is only one facet of the fight for empowerment. Concomitantly, the year saw women stack up achievements on an unprecedented scale.

C) It means he is angry enough to incinerate anything that comes in his way.

D) Across the world, there was a furious outpouring of rage against men in power, men on the street, men at home, and in families.

A) ABCD B) CBDA
C) DBAC D) DACB
 
Answer & Explanation Answer:

Explanation:

The correct sequence is CADB.

Report Error

View Answer Report Error Discuss

Filed Under: English

0 2765