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

Which of the following is an instance of informative speaking?

A) a student sharing ideas about leadership based on a book she has read B) a student on stage telling jokes during the intermission of a play
C) a student urging an instructor to reconsider the due date for an assignment D) All of the above
 
Answer & Explanation Answer: A) a student sharing ideas about leadership based on a book she has read

Explanation:

Informative Speaking is a 10-minute presentation written and performed by the student. Informative requires students to balance that content with delivery and style.

Here in the given options, option A) a student sharing ideas about leadership based on a book she has read, is an instance of informative speaking.

 

Students in Informative must be articulate, engaging, and smooth with their delivery at both a vocal and physical level.

Report Error

View Answer Report Error Discuss

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

2 2653
Q:

Monopotassium tartarate was used in

A) Fertiliser B) Explosives
C) Photography D) Baking
 
Answer & Explanation Answer: D) Baking

Explanation:

Monopotassium tartarate was used in baking powder.

Report Error

View Answer Report Error Discuss

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

0 2653
Q:

Which gas is not produced by volcanic eruptions?

A) Methane B) carbon dioxide
C) sulfur dioxide D) hydrochloric acid
 
Answer & Explanation Answer: A) Methane

Explanation:

Many toxic gases along with water vapour are emitted in vocanic eruptions. All such toxic gases include hydrochloric acid, sulfur dioxide, carbon dioxide, hydrogen sulfide and carbon monoxide. Methane is not produced in the volcanic eruptions.

which_gas_is_not_produced_by_volcanic_eruptions1559201445.jpg image

Report Error

View Answer Report Error Discuss

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

2 2653
Q:

India's first-ever autism township will come up in?

A) Telangana B) West Bengal
C) Karnataka D) Gujarat
 
Answer & Explanation Answer: B) West Bengal

Explanation:

India's first-ever autism township will come up in West Bengal.

Report Error

View Answer Report Error Discuss

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

2 2652
Q:

Select the correct statement about the ureters.

A) The ureter is innervated by parasympathetic nerve endings only. B) Ureters contain sphincters at the entrance to the bladder to prevent the backflow of urine.
C) The epithelium is stratified squamous like the skin, which allows a great deal of stretch. D) The ureters are capable of peristalsis like that of the gastrointestinal tract.
 
Answer & Explanation Answer: D) The ureters are capable of peristalsis like that of the gastrointestinal tract.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: AIEEE
Job Role: Analyst

2 2652
Q:

Which city has been named as the world's most liveable city for the seventh year in a row by The Economist in its Global Liveability Report ?

A) Hyderabad B) Vienna
C) Melbourne D) New Delhi
 
Answer & Explanation Answer: C) Melbourne

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Places
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

8 2652
Q:

One of the following companies does have business interest in both oil and shipping sectors. Identify this.

A) Tata Group B) Reliance Group
C) Essar Group D) ONGC
 
Answer & Explanation Answer: C) Essar Group

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

6 2652