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

Head Quaters of NATO is located in 

A) Newyork B) Brussels
C) Alaska D) California
 
Answer & Explanation Answer: B) Brussels

Explanation:

Head Quaters of NATO is located in Brussels

Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

5 2645
Q:

RBI appoints _______ as New Executive Director in 2017 ?

A) Smt. Malvika Sinha B) Smt. Girija Rana
C) Smt. Indira Devi D) CP Rajan
 
Answer & Explanation Answer: A) Smt. Malvika Sinha

Explanation:

The Reserve Bank of India has appointed Smt. Malvika Sinha as Executive Director (ED).

As Executive Director Smt. Sinha will look after Foreign Exchange Department, Department of Government and Bank Accounts and Internal Debt Management Department.

Smt. Malvika Sinha holds a Masters Degree from University of Bombay and has done her Masters in Public Administration. She is also a Certificated Associate of Indian Institute of Bankers.

Smt. Sinha joined Reserve Bank in 1982 and as a career central banker served in the areas of regulation and supervision, foreign exchange and Government and Bank Accounts in the Bank. Prior to being promoted as ED, Smt. Sinha was Principal Chief General Manager, Department of Co-operative Banking Supervision in the Reserve Bank.

Report Error

View Answer Report Error Discuss

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

5 2645
Q:

Who decides to implement split MOPP?

Answer

The concept of maintaining heightened protective posture only in those areas (or zones) that are contaminated, allowing personnel in uncontaminated areas to continue to operate in a reduced posture. Also called split-MOPP. Airbases or operating locations are divided into sectors allowing MOPP levels and alarm conditions to be adjusted based on the level of threat.


 


The installation commander decides to implement Split MOPP concept when and where ever necessary.

Report Error

View answer Workspace Report Error Discuss

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

1 2644
Q:

Would the following program compile?

main()

{

    int a = 10, *j;

    void *k;

    J = k = &a;

    J++;

    k++;

   printf ("\n%u %u", j, k);

}

Answer

An error would be reported in the statement k++ since arithmetic on void pointers is not permitted unless the void pointer is appropriately typecasted.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2644
Q:

IQTA system abolished by

A) Illtumish B) Bin Tughluq
C) Alauddin Khalji D) None of the above
 
Answer & Explanation Answer: C) Alauddin Khalji

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2644
Q:

Which of the following is the sacred book of Judaism?

A) Old Testament B) Aporypha
C) Avesta D) Both (a) and (b)
 
Answer & Explanation Answer: D) Both (a) and (b)

Explanation:

The sacred books of judaism form the Old Testament and Aporypha. These books contain the history of the Jews and lay down the religious laws and ethics which they must follow.

Report Error

View Answer Report Error Discuss

Filed Under: World History

3 2644
Q:

In Germany the Mittle Land Canal runs from the 

A) Elbe to the Wesser B) Rhine to the Wesser
C) Order to the Elbe D) Rhine to the Order
 
Answer & Explanation Answer: D) Rhine to the Order

Explanation:

In Germany an important system of canals has been built in the low lying land between the Baltic Heights and the mountains in the southern part of the country. The Channels cut by these Ice-age rivers and later abandoned, have made it comparatively easy to join up the present river by canals which assist considerably in the movement of heavy goods in the north German Plain

Report Error

View Answer Report Error Discuss

Filed Under: World Geography

1 2643