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

What are the operating system components?

Answer

- Process management


- Main memory management


- File management


- I/O system management


- Secondary storage management


- Networking


- Protection system


- Command interpreter system

Report Error

View answer Workspace Report Error Discuss

2 2673
Q:

In Which three languages is the Rosetta Stone written?

Answer

Greek, demotic Egyptian and hieroglyphics.

Report Error

View answer Workspace Report Error Discuss

Subject: World History

0 2672
Q:

Each item consists of six sentences of a passage. The first and sixth sentences are given in the beginning as S1 and S6. The middle four sentences in each have been jumbled up and labelled as P, Q, R and S. You are required to find the proper sequence of the four sentences and mark your response accordingly on the Answer Sheet.

S1 :The Nobel Prize for Economics in 2018 was awarded to Paul Romer and William Nordhaus for their work in two separate areas : economic growth and environmental economics respectively.
S6 :Among recent winners of Nobel Prize in Economics, it’s hard to think of one issue which is more topical and relevant to India.
P :But there is a common thread in their work.
Q : In economic jargon it’s termed as externality.
R : Productive activity often has spillovers, meaning that it can impact an unrelated party.
S :Romer and Nordhaus both studied the impact of externalities and came up with profound insights and economic models.
The correct sequence should be

A) P Q R S B) P R Q S
C) Q S P R D) Q S R P
 
Answer & Explanation Answer: B) P R Q S

Explanation:

PRQS is the correct order in which sentences should be arranged

Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2672
Q:

Which of the following is a polymer?

A) Glycerol B) Amino acid
C) Nucleic acid D) Fatty acid
 
Answer & Explanation Answer: C) Nucleic acid

Explanation:

Nucleic acid is a polymer among the given options.

Report Error

View Answer Report Error Discuss

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

1 2671
Q:

Which of these statements is true of the kingdom protista?

A) All are unicellular B) All are hetertrophic
C) All are autotrophic D) All are eukaryotic
 
Answer & Explanation Answer: D) All are eukaryotic

Explanation:

Protists are eukaryotic organisms that cannot be classified as a plant, animal, or fungus. They are mostly unicellular, but some, like algae, are multicellular.

which_of_these_statements_is_true_of_the_kingdom_protista1536211148.jpg image

Kelp, or 'seaweed,' is a large multicellular protist that provides food, shelter, and oxygen for numerous underwater ecosystems.

Report Error

View Answer Report Error Discuss

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

1 2671
Q:

A VM/VSE customer wants to implement a WAS on an existing zSeries server. On which of the following operating environments would WAS best be implemented?

A) VSE B) z/VM
C) z/OS D) Linux
 
Answer & Explanation Answer: D) Linux

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: IBM Certification

1 2671
Q:

What command would you use to create a backup control file?

Answer

Alter database backup control file to trace

Report Error

View answer Workspace Report Error Discuss

3 2671