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

Which cartoon characters were created by William Hanna and Joseph Barbara in 1940?

A) Oswald & Noddy B) Tom & Jerry
C) Mickey mouse & Sylvester D) Donald duck & Tweety
 
Answer & Explanation Answer: B) Tom & Jerry

Explanation:

Tom Cat and Jerry Mouse were the two cartoon characters created by William Hanna and Joseph Barbara in 1940.

Report Error

View Answer Report Error Discuss

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

3 2654
Q:

Which one of the following is a search engine?

A) Bing B) Reddit
C) Pinterest D) Twitter
 
Answer & Explanation Answer: A) Bing

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2654
Q:

Chemically marble is known as

A) Calcareous rock B) Siliceous Rock
C) Argillaceous Rock D) Metamorphic Rock
 
Answer & Explanation Answer: A) Calcareous rock

Explanation:

Chemically marble is known as Calcareous rock as it is composed of carbonate minerals like calcite or dolomite.

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

3 2654
Q:

The U-shaped skyscraper ‘The Big Bend’ will be build in which city ?

A) New York B) Florida
C) Texas D) California
 
Answer & Explanation Answer: A) New York

Explanation:

The design plans for the U-shaped skyscraper ‘The Big Bend’ in New York, hailed as the world’s longest building, have been revealed. The 4,000-foot long building will feature an elevator system that can travel in curves, horizontally and in loops.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

3 2653
Q:

The Buddh International Circuit is in

A) Gandhinagar B) Greater Noida
C) Guwahati D) New Delhi
 
Answer & Explanation Answer: B) Greater Noida

Explanation:

The Buddh International Circuit, an Indian motor racing circuit, is located in Greater Noida.

Report Error

View Answer Report Error Discuss

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

13 2653
Q:

How many Nucleotides make up a Codon?

A) 3 B) 4
C) 5 D) 6
 
Answer & Explanation Answer: A) 3

Explanation:

3 Nucleotides make up a Codon. 

The nucleotide triplet that encodes an amino acid is called a codon.

Each group of three nucleotides encodes one amino acid.

Report Error

View Answer Report Error Discuss

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

6 2652
Q:

Gluconeogenesis is a term that describes the synthesis of

Answer

Gluconeogenesis is a metabolic pathway that leads to the synthesis of glucose from pyruvate and other non-carbohydrate precursors, even in non-photosynthetic organisms.


 


It occurs in all microorganisms, fungi, plants and animals, and the reactions are essentially the same, leading to the synthesis of one glucose molecule from two pyruvate molecules. Therefore, it is in essence glycolysis in reverse, which instead goes from glucose to pyruvate, and shares seven enzymes with it.

Report Error

View answer Workspace Report Error Discuss

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

0 2652