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

Which of the following commands will allow a Linux on iSeries administrator to quickly scan backup tapes for files saved via a tar command on a Linux system?

A) The Linux command mt B) The Linux command cpio
C) The OS/400 command RST option(*print) D) The OS/400 command DSPTAP option(*savrst)
 
Answer & Explanation Answer: B) The Linux command cpio

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: IBM Certification

1 2920
Q:

Study of teeth is called

A) Pedagogy B) Ornithology
C) Orthoepy D) Odontology
 
Answer & Explanation Answer: D) Odontology

Explanation:

The study or scientific study of the structure, development, and abnormalities of the teeth is called Odontology. The science that studies teeth and their surrounding tissues, especially the prevention and cure of their diseases is called Dentology.
 

Report Error

View Answer Report Error Discuss

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

5 2920
Q:

The rate of flow of electric charge is measured in

A) ampere B) coulomb
C) ampere/coulomb D) ampere-coulomb
 
Answer & Explanation Answer: A) ampere

Explanation:
Report Error

View Answer Report Error Discuss

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

3 2920
Q:

Which of the following is a Non Renewable Resource of Energy?

A) Wind Power B) Hydrogen Fuel
C) Natural Gas D) Solar Energy
 
Answer & Explanation Answer: C) Natural Gas

Explanation:

Natural Gas is a Non Renewable Resource of Energy because that does not renew itself once used, unlike the other choices. 

It is a resource that will not be naturally replenished.

Report Error

View Answer Report Error Discuss

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

3 2919
Q:

The international date line passes through

A) Hudson Bay B) Denmark Strait
C) Bering Strait D) Baffin Bay
 
Answer & Explanation Answer: C) Bering Strait

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2919
Q:

Charak was a native of

A) Tamil Nadu B) Kashmir
C) Punjab D) Rajasthan
 
Answer & Explanation Answer: B) Kashmir

Explanation:

Charak was a native of Kashmir.

Report Error

View Answer Report Error Discuss

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

1 2918
Q:

National Science Centre is located at

A) New Delhi B) Pune
C) Bangalore D) Hyderabad
 
Answer & Explanation Answer: A) New Delhi

Explanation:

National Science Centre is located at New Delhi.

national_science_centre_is_located_at1553943841.jpg image

Report Error

View Answer Report Error Discuss

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

0 2918