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

Addis Ababa is the Capital city of

A) Angola B) Burundi
C) Chile D) Ethiopia
 
Answer & Explanation Answer: D) Ethiopia

Explanation:

The Capital city of Ethiopia is Addis Ababa.

 

Countries and Capital cities ::

Angola  -  Launda

Burundi  -  Bujumbura

Chile  -  Santiago

Report Error

View Answer Report Error Discuss

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

2 2382
Q:

The leader of the opposition, (in the manner he had planned to convince them,on) P (realising that he had failed to convince the) Q (assembly,who had a reputation for speech) R (making,was very much disappointed) S

The correct sequence should be

A) P S R Q B) Q S R P
C) R S Q P D) S P R Q
 
Answer & Explanation Answer: C) R S Q P

Explanation:

Since, the sentence starts talking about the leader of the opposition, the connecting statement will be R as it carries a relative pronoun ‘who’ which relates the sentences. S follows as it states the disappointment of the leader and the next statement talked about the reason of disappointment. P would be the concluding statement as it goes with the flow describing how the leader decided to convince the assembly and thus makes a coherent paragraph.

The correct formation would be, ‘The leader of the opposition who had a reputation for speech making was very much disappointed on realising that he had failed to convince the assembly in the manner he had planned to convince them’.

Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2382
Q:

Which one of the following is not correct about Sargasso Sea?

A) It is characterized with anticyclonic circulation of ocean currents B) It records the highest salinity in Atlantic Ocean
C) It is located west ofGulf Stream and east of Canary Current D) It confined in gyre of calm and motionless water
 
Answer & Explanation Answer: A) It is characterized with anticyclonic circulation of ocean currents

Explanation:

The calm centre of the anticyclonic gyre in the North Atlantic, comprising a large eddy of surface water, the boundaries of which are demarcated by major current systems such as the Gulf Stream, Canaries Current, and North Atlantic Drift. The Sargasso Sea is a large, warm (18°C), saline, which is characterized by an abundance of floating brown seaweed (Sargassum).

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

1 2381
Q:

Forbes' 2017 named ______ world's richest man ?

A) Bill Gates B) Ratan Tata
C) Mukesh Ambani D) Donald Trump
 
Answer & Explanation Answer: A) Bill Gates

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2381
Q:

Who presented the Union Budget of India, the maximum number of times (10)?

A) T. T. Krishnamachari B) Morarji Desai
C) Jaswant Singh D) R.K Shanmukham Chetty
 
Answer & Explanation Answer: B) Morarji Desai

Explanation:
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 2380
Q:

Wilhelm I was declared kaiser of Germany in

A) 1797 B) 1841
C) 1871 D) 1914
 
Answer & Explanation Answer: C) 1871

Explanation:

In Germany, Kaiser means 'Emperor'. On 18th January, 1871 Wilhelm I was declared as Kaiser of Germany.

Report Error

View Answer Report Error Discuss

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

0 2380