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

Which of these equations best summarizes photosynthesis?

A) CO2 + H2O -----> C6H12O6 + 6O2 B) 6O2 + 6H2O -----> C6H12O6 + 6CO2
C) 6CO2 + 6H2O -----> C6H12O6 + 6O2 D) C6H12O6 + 6O2 -----> CO2 + 6H2O
 
Answer & Explanation Answer: C) 6CO2 + 6H2O -----> C6H12O6 + 6O2

Explanation:

Here 6CO2 + 6H2O -----> C6H12O6 + 6O2 is the only option which best summarizes photosynthesis. We know that, photosynthesis is the reverse of cellular respiration in that carbon dioxide is used with water to form sugar, and oxygen is released.

 

Which_of_these_equations_best_summarizes_photosynthesis1553579499.png image

Report Error

View Answer Report Error Discuss

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

0 2656
Q:

Who is the author of ' The Accidental Prime Minister - The Making and Unmaking of Manmohan Singh'

Answer

Sanjaya Baru

Report Error

View answer Workspace Report Error Discuss

3 2655
Q:

In plants, chloroplasts are necessary for 

A) photosynthesis B) storage
C) cell movement D) respiration
 
Answer & Explanation Answer: A) photosynthesis

Explanation:

Plants are producers, which means they make their own food. Chloroplasts are organelles found in eukaryotic and plant cells that conduct photosynthesis. Chloroplasts absorb sunlight and use it in conjunction with water and carbon dioxide gas to produce food for the plant.

Plants use energy from sunlight to help make their food, but they need chloroplasts to do it.

 

Hence, in plants, chloroplasts are necessary for Photosynthesis.

Report Error

View Answer Report Error Discuss

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

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

Have you had experience of locking up a shop and dealing with stock ordering?

Answer

These are a couple of examples of things that retail staff may be expected to get involved with, and they'll be keen to see how much additional training they might need to provide.

Report Error

View answer Workspace Report Error Discuss

Subject: Retail

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

Strength of concrete increases with

A) increase in fineness of cement B) decrease in size of aggregate
C) increase in water cement ratio D) decrease in curing time
 
Answer & Explanation Answer: C) increase in water cement ratio

Explanation:

Strength of concrete increases with increase in water cement ratio as the strength of the cement is directly proportional to water cement ratio.

Report Error

View Answer Report Error Discuss

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

2 2652