Questions

Q:

Write a c program for insertion sort.

Answer

#include<stdio.h>
int main(){

  int i,j,s,temp,a[20];

  printf("Enter total elements: ");
  scanf("%d",&s);

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

  for(i=1;i<s;i++){
      temp=a[i];
      j=i-1;
      while((temp<a[j])&&(j>=0)){
      a[j+1]=a[j];
          j=j-1;
      }
      a[j+1]=temp;
  }

  printf("After sorting: ");
  for(i=0;i<s;i++)
      printf(" %d",a[i]);

  return 0;
}

Output:
Enter total elements: 5
Enter 5 elements: 3 7 9 0 2
After sorting:  0 2 3 7 9

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2881
Q:

5 Digits Number?

What 5-digit number has the following features:

If we put the numeral 1 at the beginning, we get a number three times smaller than if we put the numeral 1 at the end of the number.

Answer

We can make an equation:


3(100000 + x) = 10x+1


(Why? Well, adding 100000 puts a 1 at the front of a five-digit number, and multiplying by 10 and adding 1 puts a 1 at the end of a number)


Solving this gives:


10x+1 = 3(100000 + x)
10x+1 = 300000 + 3x
10x = 299999 + 3x
7x = 299999
x = 299999/7 = 42857


The answer is 42857 (142857 is three times smaller than 428571).

Report Error

View answer Workspace Report Error Discuss

9 2879
Q:

Which warship has become the India’s first warship to install solar panels on board ?

A) INS Sindhudurg B) INS Sarvekshak
C) NS Vindhyagiri D) INS Godavari
 
Answer & Explanation Answer: B) INS Sarvekshak

Explanation:

Indian Navy’s survey vessel INS Sarvekshak has become the India’s first warship to install solar power system on board. The solar power system works on sunlight and hence is 100% per cent reliable for power source that can be used for communication equipment, battery charging and general lightings onboard round the clock with battery outputs during night. The system is maintenance free.

Report Error

View Answer Report Error Discuss

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

1 2879
Q:

Farmers' cooperatives were most common among

A) Cotton producers B) Grain producers
C) Fruit growers D) Tobacco growers
 
Answer & Explanation Answer: C) Fruit growers

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2879
Q:

Where is a hub specified in the OSI model?

A) Data link layer B) Session layer
C) Application Layer D) Physical layer
 
Answer & Explanation Answer: D) Physical layer

Explanation:

Hubs are specified or operate at Layer1 i.e, the physical layer in the OSI model. Hubs regenerate electrical signals. A hub sends data packets (frames) to all devices on a network, regardless of any MAC addresses contained in the data packet.

Report Error

View Answer Report Error Discuss

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

0 2878
Q:

Laconic most nearly means

A) Talkative B) Wordy
C) Brief D) Long
 
Answer & Explanation Answer: C) Brief

Explanation:

Laconic means using only few words in his/her speech or while talking.

In the given options, talkative, wordy and long are all opposite to laconic and brief is the only word which is similar in meaning of laconic.

Report Error

View Answer Report Error Discuss

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

1 2878
Q:

What is one map unit equivalent to

A) 1% recombination frequency B) the distance between a pair of homologous chromosomes
C) Both A & B D) 1 nanometer of distance between two genes
 
Answer & Explanation Answer: A) 1% recombination frequency

Explanation:

The distance between two genes is measured with a unit called map unit. One map unit is equivalent to 1% recombination frequency.

Report Error

View Answer Report Error Discuss

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

3 2878
Q:

What does the term Jim Crow refer to? 

A) the civil rights movement of the mid-twentieth century B) northern whites who sympathized with African Americans
C) African American politicians during Reconstruction D) the system of racial segregation in the South after Reconstruction
 
Answer & Explanation Answer: D) the system of racial segregation in the South after Reconstruction

Explanation:
Report Error

View Answer Report Error Discuss

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

0 2877