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

What is market risk?

Answer

It refers to the possibility for an investor to experience  losses due to  factors that affect the overall performance of the financial markets. Market risk cannot be eliminated through diversification, though it can be hedged against. The sources of market risk include natural disasters, recessions, political turmoil, changes in interest rates and terrorist attacks.

Report Error

View answer Workspace Report Error Discuss

0 2710
Q:

Selecting and managing marketing channels :

How are the channel members managed and motivated, once they are selected?

Answer

These days channel members are being accepted by companies as their partners. The intermediaries are even being asked to integrate their business with the companies which results in lesser costs, greater efficiency and improved customer service. Corporates like Airtel are adopting PRM (Partner relationship management) software to give that added advantage to their supply chain. They organise rewards and recognition programs for their channel partners and also organise proper channels though which partners can vent any of their grievances relating to payments, violation of codes etc.

Report Error

View answer Workspace Report Error Discuss

0 2709
Q:

Which of the following is an interjection?

A) Alas B) Yikes
C) Oh D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: AIEEE , Bank Exams , CAT , GRE , TOEFL
Job Role: Analyst , Bank Clerk , Bank PO

1 2708
Q:

Artocarpus integra is the scientific name of ___________.

A) Guava B) Pineapple
C) Silver Oak D) Jack fruit
 
Answer & Explanation Answer: D) Jack fruit

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: Bank Exams

2 2708
Q:

The two broad categories of software are

A) Drivers and MS office B) Application and Spreadsheets
C) System and Application D) Utility programs and System
 
Answer & Explanation Answer: C) System and Application

Explanation:

The two broad categories of software in a computer are

1. System software
2. Application software

 

the_two_broad_categories_of_software_are1560849803.jpg image

System software controls how the system works and enables user to access all of the system hardware and application software

The OS, utility programs and drivers come under system software.

 

Application software are software used by the user to perform specific task. They are installed according to the user's requirements.

The word processor, web browser, players, spreadsheets etc... come under this application software.

Report Error

View Answer Report Error Discuss

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

3 2708
Q:

Which of the following reactions are redox reactions?

A) Ba(s)+Cl2(g)--->BaCl2(s) B) Mg(s)+Br2(l)--->MgBr2(s)
C) Al(s)+3Ag^+(aq)--->Al^3+(aq)+3Ag(s) D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

A redox reaction is a type of reaction which involves transfer of electrons among two species. This reaction is also called oxidation-reduction reaction.

In oxidation process, there is an increase in oxidation state of an atom, ion or molecule by losing the electrons.

In reduction process, there is a decrease in oxidation state of an atom, ion or molecule by accepting the electrons.

1)

image

In this reaction, Ba undergoes oxidation and Cl undergoes reduction.
This reaction is redox reaction.
In this reaction, oxidation number of Ba increases from 0 to +2 . So, Ba undergoes oxidation. The oxidation number of Cl decreases from 0 to -1. So, Cl undergoes reduction.

 

2) 

 

image

From this above reaction, it is clear that Aluminum undergoes oxidation and silver undergoes reduction.
Due to this, this reaction is redox reaction.

In this reaction, oxidation number of Aluminum increases from 0 to +1. So, aluminum undergoes oxidation. The oxidation number of silver decreases from +1 to 0. So, silver undergoes reduction.

 

3)


image

In this reaction, Mg undergoes oxidation and Br undergoes reduction.
This reaction is redox reaction.
The reactions 1, 3 and 4 are redox reactions.
In this reaction, oxidation number of Mg increases from 0 to +2 . So, Mg undergoes oxidation. The oxidation number of Br decreases from 0 to -1 . So, Br undergoes reduction.

 

Hence all the above reactions are redox reactions.

Report Error

View Answer Report Error Discuss

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

1 2706
Q:

What occurs when an atom loses an electron?

A) The atom's radius decreases and the atom becomes a positive ion. B) The atom's radius increases and the atom becomes a negative ion.
C) The atom's radius decreases and the atom becomes a negative ion. D) The atom's radius increases and the atom becomes a positive ion.
 
Answer & Explanation Answer: A) The atom's radius decreases and the atom becomes a positive ion.

Explanation:

When an atom loses an electron it becomes a positive ion by acquiring negatively charged. When it loses electron, the atom's radius also decreased.

Report Error

View Answer Report Error Discuss

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

1 2705