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

What is 'Rakshita', with reference to DRDO?

 

A) Bike-based Ambulance B) Water Ambulance
C) Air Ambulance D) Unmanned Aerial Vehicle
 
Answer & Explanation Answer: A) Bike-based Ambulance

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

1 2378
Q:

The velocity required to place a vehicle in orbit round the moon is _______ that required to place it in orbit round the earth 

A) less than B) Greater than
C) equal to D) greater than or equal to
 
Answer & Explanation Answer: A) less than

Explanation:

This orbital velocity at the moon is less because orbital velocity = rg

 

where 'r ' is the orbital radius. i.e the distance of the body from the center of the earth and 'g' is the acceleration due to gravity on the body in question. In the case of the moon, both r and g are less than in the case of the earth.

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: AIEEE , GATE

2 2378
Q:

What is the smallest unit that can evolve?

Answer

The population is the smallest unit of living organisms that can undergo evolution.

Report Error

View answer Workspace Report Error Discuss

Subject: General Awareness Exam Prep: AIEEE , Bank Exams , GATE
Job Role: Analyst , Bank Clerk , Bank PO

0 2377
Q:

Which of he following Chief Minister has been selected for the award of ‘Transformative Chief Minister’ by The US India Business Council ?

A) N. Chandrababu Naidu B) Devendra Fadnavis
C) K. Chandra Shekar Rao D) Mamata Banerjee
 
Answer & Explanation Answer: A) N. Chandrababu Naidu

Explanation:

Chief Minister of Andhra Pradesh, N Chandrababu Naidu has been selected for another prestigious award. The US India Business Council has selected the CM for award of ‘Transformative Chief Minister’ and Naidu would be receiving coveted award at second annual West Coast summit which to be held in California on May 8, 2017.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

2 2377
Q:

What would be the output of the following program?

main()

{

     char ch ='A';

      printf ("%d%d", sizeof (ch), sizeof ('A'));

}

Answer

1   2

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2377
Q:

Can You Solve This Tricky Puzzle In 10 Seconds?

Answer

In the last row fifth letter is 'I'.

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles Exam Prep: Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

38 2377
Q:

Lady Ratan Tata Trophy' is related to which game?

A) Basketball B) Hockey
C) Kho-Kho D) Cricket
 
Answer & Explanation Answer: B) Hockey

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports
Exam Prep: Bank Exams

3 2377