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

Who becomes the first Indian woman President of Indian National Congress?

A) Pratibha Patil B) Annie Besant
C) Sarojini Naidu D) Vijaya Lakshmi
 
Answer & Explanation Answer: C) Sarojini Naidu

Explanation:

The first Indian woman President of Indian National Congress was Sarojini Naidu in the year 1925.

 

First woman to become the president of INC - Annie Besant 1917.

Report Error

View Answer Report Error Discuss

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

0 2917
Q:

An ecosystem consists of

A) all the plants and animals of an area B) producers, consumers, and decomposers in a particular locality
C) a living community and its environment D) carnivores and herbivores of an area
 
Answer & Explanation Answer: C) a living community and its environment

Explanation:

A living community and its environment is what an ecosystem is.

An_ecosystem_consists_of1535781515.jpg image

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

2 2916
Q:

In which Organelle does Cellular Respiration Occur?

A) Chloroplast B) ATP and NADPH
C) Cytoplasm D) Mitochondria
 
Answer & Explanation Answer: D) Mitochondria

Explanation:

Mitochondria is the Organelle in which Cellular Respiration Occur.

Report Error

View Answer Report Error Discuss

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

9 2915
Q:

Which one of the following National Highways is the longest

A) NH-2 B) NH-7
C) NH-8 D) NH-15
 
Answer & Explanation Answer: B) NH-7

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

4 2915
Q:

Which mosque is considered to be the style of Bengal style in Agra?

A) Nagina Masjid B) Moti Masjid
C) Jama Masjid D) Badshahi Masjid
 
Answer & Explanation Answer: A) Nagina Masjid

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: Bank Exams

0 2914
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 2914
Q:

The total number of judges of the International Court of Justice is

A) 10 B) 12
C) 15 D) 18
 
Answer & Explanation Answer: C) 15

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

0 2914