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

Who owns Tradestation?

A) SBI Group B) Monex Group, Inc.
C) CME Group D) None of the above
 
Answer & Explanation Answer: B) Monex Group, Inc.

Explanation:

Tradestation is owned by its parent organization Monex Group, Inc.

Report Error

View Answer Report Error Discuss

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

0 2744
Q:

Major fructose sources include

A) breads and cereals B) beer and liquor
C) milk and cheese D) fruits and honey
 
Answer & Explanation Answer: D) fruits and honey

Explanation:
Report Error

View Answer Report Error Discuss

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

4 2744
Q:

Which of these did progressives support?

Answer

One of the thing that progressive support would be: Direct election of senators.


 


The progressive wanted this so they could the candidate based on the person and not the party.
Direct election of senators will make it easier for them to elect the person that represent their value for the position.

Report Error

View answer Workspace Report Error Discuss

Subject: Indian Politics Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

4 2743
Q:

Name the sea demoness known for trapping birds by illusion, who tried to obstruct Hanuman on his way to Lanka?

Answer

Simhika

Report Error

View answer Workspace Report Error Discuss

Subject: Indian Culture

33 2743
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 2743
Q:

Elastomers can extend upto

A) ten times their original dimensions B) seven times their original dimensions
C) five times their original dimensions D) three times their original dimensions
 
Answer & Explanation Answer: B) seven times their original dimensions

Explanation:

An elastomer is a polymer with viscoelasticity which have low youngs modulus with weak intermolecular forces when compared with other materials.

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

Arrange the given words in the sequence in which they occur in the dictionary.

1. Ropped
2. Roster
3. Roasted
4. Road
5. Roller

A) 35412 B) 45312
C) 34512 D) 43512
 
Answer & Explanation Answer: D) 43512

Explanation:
Report Error

View Answer Report Error Discuss

0 2742