Questions

Q:

What would be the output of the following program?

/* sample.c */

main ( int argc, char **argv )

{

     argc = argc - (argc -1);

     printf ("%s", argv[argc - 1]);

}

Answer

C: \SAMPLE.EXE

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2376
Q:

Write a c program for merge sort.

Answer

#include
#define MAX 50

void mergeSort(int arr[],int low,int mid,int high);
void partition(int arr[],int low,int high);

int main(){
  
    int merge[MAX],i,n;

    printf("Enter the total number of elements: ");
    scanf("%d",&n);

    printf("Enter the elements which to be sort: ");
    for(i=0;i<n;i++){
         scanf("%d",&merge[i]);
    }

    partition(merge,0,n-1);

    printf("After merge sorting elements are: ");
    for(i=0;i<n;i++){
         printf("%d ",merge[i]);
    }

   return 0;
}

void partition(int arr[],int low,int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(int arr[],int low,int mid,int high){

    int i,m,k,l,temp[MAX];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }
  
    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


Sample output:

Enter the total number of elements: 5
Enter the elements which to be sort: 2 5 0 9 1
After merge sorting elements are: 0 1 2 5 9

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2376
Q:

Which describes how Africa was divided into countries?

A) Ethnic groups were each given their own country B) Artificial political unity was attempted
C) Boundaries were made according to language similarities D) Nomadic peoples were given control of their lands
 
Answer & Explanation Answer: A) Ethnic groups were each given their own country

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2375
Q:

Who become the brand ambassador of the Swast Immunised India campaign?

A) Kareena Kapoor B) Deepika Padukone
C) Ranveer Singh D) Shilpa Shetty
 
Answer & Explanation Answer: A) Kareena Kapoor

Explanation:

The brand ambassador of the Swast Immunised India campaign is Kareena Kapoor Khan.

Report Error

View Answer Report Error Discuss

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

1 2375
Q:

What molecule carries genetic information?

A) RNA B) DNA
C) Proteins D) Nucleotides
 
Answer & Explanation Answer: B) DNA

Explanation:

The nucleus of a cell contains chromosomes, which carry genetic information in a long molecule called DNA.

Genes are regions of DNA that carry the code to control a particular cell activity or the production of a particular protein.

Report Error

View Answer Report Error Discuss

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

1 2375
Q:

What is Bull Market?

Answer

Bull market is that market where stock value are expected rise and people will have tendency to sell their stock so as to earn profit out of it. Thus sudden push from the suppliers will gradually niutalise the market.


 

Report Error

View answer Workspace Report Error Discuss

Subject: Finance

0 2374
Q:

Which statement best describes the relationship between science and technology?

A) Technology is a branch of science. B) Advances in science can lead to new technology.
C) Without technology there is no science. D) Technology is not related to science.
 
Answer & Explanation Answer: B) Advances in science can lead to new technology.

Explanation:

The aim of science is to get an understanding of the natural world, while the aim of technology is to use that understanding to improve people's lives. 

 

Hence, Advances in science can lead to new technology.

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

3 2374
Q:

A computer port is used to

A) Donwload files B) Communicate with other computer peripherals
C) Communicate with hard disks D) All of the above
 
Answer & Explanation Answer: B) Communicate with other computer peripherals

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2374