Questions

Q:

Write a c program for quick sort.

Answer

#include<stdio.h>

void quicksort(int [10],int,int);

int main(){
  int x[20],size,i;

  printf("Enter size of the array: ");
  scanf("%d",&size);

  printf("Enter %d elements: ",size);
  for(i=0;i<size;i++)
    scanf("%d",&x[i]);

  quicksort(x,0,size-1);

  printf("Sorted elements: ");
  for(i=0;i<size;i++)
    printf(" %d",x[i]);

  return 0;
}

void quicksort(int x[10],int first,int last){
    int pivot,j,temp,i;

     if(first<last){
         pivot=first;
         i=first;
         j=last;

         while(i<j){
             while(x[i]<=x[pivot]&&i<last)
                 i++;
             while(x[j]>x[pivot])
                 j--;
             if(i<j){
                 temp=x[i];
                  x[i]=x[j];
                  x[j]=temp;
             }
         }

         temp=x[pivot];
         x[pivot]=x[j];
         x[j]=temp;
         quicksort(x,first,j-1);
         quicksort(x,j+1,last);

    }
}

Output:
Enter size of the array: 5
Enter 5 elements: 3 8 0 1 2
Sorted elements: 0 1 2 3 8

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2807
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 2806
Q:

Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it.

Reporters and city officials gathered at a Chicago railroad station one afternoon in 1953. The person they were meeting was the 1952 Nobel Peace Prize winner. A few minutes after the train came to a stop, a giant of a man - six feet four inches - with bushy hair and a large moustache stepped out from the train. Cameras flashed. City officials approached him with hands outstretched. Various people began telling him how honoured they were to meet him.

The man politely thanked them and then, looking over their heads, asked if he could be excused for a moment. He quickly walked through the crowd until he reached the side of an elderly black woman who was struggling with two large suitcases. He picked up the bags with a smile, escorted the woman to a bus. After helping her aboard, he wished her a safe journey. As he returned to the greeting party he apologized, "Sorry to have kept you waiting." Not many whites would have done what he did.

The man was Dr. Albert Schweitzer, the famous missionary doctor who had spent his life helping the poor in Africa. In response to Dr. Schweitzer's action, one member of the reception committee said with great admiration to the reporter standing next to him, "That's the first time I ever saw a sermon walking."


Dr. Albert delighted _____ .

A) in being helped by others B) in not being honoured
C) in being honoured D) in helping others
 
Answer & Explanation Answer: D) in helping others

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2805
Q:

Support staff in the office of the president include

A) Repoters B) Cabinet members
C) Administrators D) All of the above
 
Answer & Explanation Answer: C) Administrators

Explanation:

Support staff in the office of the president include Administrators.

Support_staff_in_the_office_of_the_president_include1539257220.jpg image

Report Error

View Answer Report Error Discuss

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

1 2805
Q:

What is the percentage of India's population to the world population

A) 6% B) 26%
C) 16% D) 36%
 
Answer & Explanation Answer: C) 16%

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

1 2804
Q:

A protein that acts as a hormone is

A) Estrogen B) Insulin
C) Both A & B D) None of the above
 
Answer & Explanation Answer: B) Insulin

Explanation:

A protein that acts as a hormone is INSULIN.

a_protein_that_acts_as_a_hormone_is1534420157.jpg image

Insulin is a peptide hormone produced by beta cells of the pancreatic islets; it is considered to be the main anabolic hormone of the body.  Insulin helps keeps your blood sugar level from getting too high or too low.  

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

2 2804
Q:

Process by which sediment is removed from its source is called

A) deposition B) erosion
C) weathering D) composition
 
Answer & Explanation Answer: B) erosion

Explanation:

Process by which sediment is removed from its source is called Erosion.

Report Error

View Answer Report Error Discuss

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

1 2804
Q:

What are the Various Register in 8085?

Answer

Accumulator register, Temporary register, Instruction register, Stack Pointer, Program Counter are the various registers in 8085

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2804