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

What is the main component of biogas and natural gas?

A) Carbon dioxide B) Butane
C) Hydrogen Sulphide D) Methane
 
Answer & Explanation Answer: D) Methane

Explanation:

Methane is the main component of biogas and natural gas.

Report Error

View Answer Report Error Discuss

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

5 2849
Q:

Which state govt launched 'My City My Budget' initiative?

A) Uttar Pradesh B) Karnataka
C) Telangana D) Andhra Pradesh
 
Answer & Explanation Answer: B) Karnataka

Explanation:
Report Error

View Answer Report Error Discuss

4 2849
Q:

The term aerotolerant anaerobe refers to an organism that

A) uses oxygen or grows without oxygen. B) requires more oxygen than is present in air.
C) does not use oxygen but tolerates it. D) requires less oxygen than is present in air.
 
Answer & Explanation Answer: C) does not use oxygen but tolerates it.

Explanation:
Report Error

View Answer Report Error Discuss

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

4 2848
Q:

In which organ RBC are selectively destroyed/recycled by macrophages?

A) Kidney B) Pancreas
C) Spleen D) Liver
 
Answer & Explanation Answer: C) Spleen

Explanation:

Spleen is called as the graveyard of RBC Red Blood Cells where they are selectively destroyed/recycled by macrophages.

Report Error

View Answer Report Error Discuss

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

1 2848
Q:

Which is India's Largest BPO (Business Process Outsourcing) Company?

A) Piogeon B) Spectramind
C) Technovate D) None of these
 
Answer & Explanation Answer: B) Spectramind

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

12 2848
Q:

Atacama  desert is located in 

A) dense forest B) grassland
C) Scrub D) all of these
 
Answer & Explanation Answer: D) all of these

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

2 2848
Q:

Which animal dont have vocal cords?

A) Dog B) Horse
C) Giraffe D) Donkey
 
Answer & Explanation Answer: C) Giraffe

Explanation:

Giraffe have no vocal cords.

Report Error

View Answer Report Error Discuss

Filed Under: Animals and Birds
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

8 2847