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

Controlling marketing activities :

What is profit ability control?

Answer

Profitability control is a mechanism of monitoring the sales made, profits earned and expenditure incurred by a company. The relative profit earning capacity of a firm’s products and consumer groups can be determined via profitability control. Sometimes surpisingly, it may be found out by companies how a small proportion of their products and even customers actually account for a significant percentage of the company’s profits. This can be achieved through profitability control. At times when the companies earn surplus profits, then such profits may even be ploughed back or reinvested. This also forms part of profitability control.

Report Error

View answer Workspace Report Error Discuss

0 2817
Q:

The oldest oil refinery in India is at

A) Haldia B) Digboi
C) Rajpur D) Noonmati
 
Answer & Explanation Answer: B) Digboi

Explanation:

Digboi, in Assam is where the oldest oil refinery in India. It was build in 1901.

Report Error

View Answer Report Error Discuss

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

3 2816
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.


Fever in the season of dengue is sending Calcuttans scurrying to hospitals for admission, triggering a shortage of beds that has forced some private health care institutes to even postpone planned surgeries. Apollo Gleneagles Hospitals on the Bypass had 504 patients in its care as on Thursday of whom 70 had been admitted with fever. Belle Vue Clinic had 180 patients, 32 of them with dengue. Calcutta Medical Research Institute had 350 patients 60 of them with fever.

The number of people admitted for treatment of fever caused by dengue or any undiagnosed illness has been rising every day across hospitals for more than a fortnight.

"There has been heavy pressure on all private hospitals for admission of dengue and cases of unknown fever since the beginning of August. Now it is a surge," said Pradip Tondon, President of the Association of Hospitals of Eastern India.

In July, four to five patients were getting admitted with fever on an average in every hospital. The number has since ballooned with the Calcutta Municipal Corporation apparently in denial about the extent of the dengue outbreak and the Government focused on playing down the threat.

Such has been the rush of patients with fever that some hospitals are calling up people to postpone admissions planned in advance, mostly for surgeries. "We have told many people to come only when we call them to confirm availability of beds," said an official at Belle Vue.


The word 'ballooned' implies

A) playing with balloons B) decreased
C) increased tremendously D) increased slightly
 
Answer & Explanation Answer: C) increased tremendously

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2816
Q:

Improve the bracketed part of the sentence.
It was so hot during the concert that some spectators passed (out).

A) away B) by
C) over D) no improvement
 
Answer & Explanation Answer: D) no improvement

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams , GRE

1 2815
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 2815
Q:

The concept of due process refers to

A) banking B) justice
C) politics D) economy
 
Answer & Explanation Answer: B) justice

Explanation:

Due process is the legal requirement that the state must respect all legal rights that are owed to a person.

Therefore, due process refers to the criminal justice system operating within the bounds of the law.

Report Error

View Answer Report Error Discuss

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

2 2815
Q:

The combined gas law relates which of the following?

A) Volume & Temperature B) Temperature & Pressure
C) Volume & Pressure D) Volume, Temperature & Pressure
 
Answer & Explanation Answer: D) Volume, Temperature & Pressure

Explanation:

The combined gas law states that the ratio between the pressure-volume product and the temperature of a system remains constant.

 

Hence it depends on all the three Volume, Temperature & Pressure.

Report Error

View Answer Report Error Discuss

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

2 2814