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

What is the basic foundation of neoclassical literature?

A) Artistic values of ancient Greece and Rome B) Puritan philosophy
C) Enlightenment theory D) Anti-Renaissance thought
 
Answer & Explanation Answer: A) Artistic values of ancient Greece and Rome

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2599
Q:

Yanam is the colony of the which of the European powers ?

A) Danish B) French
C) Spanish D) Portugese
 
Answer & Explanation Answer: B) French

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

0 2599
Q:

Which of the following terms follows the trend of the given list?

YXXXXXXY, YXXXXXYX, YXXXXYXX, YXXXYXXX, YXXYXXXX, _______________

A) YYXXXXXX B) YXXXXXXY
C) YXXXXXYX D) YXYXXXXX
 
Answer & Explanation Answer: D) YXYXXXXX

Explanation:
Report Error

View Answer Report Error Discuss

0 2599
Q:

How many periods in National Hockey League?

A) 2 B) 3
C) 4 D) 5
 
Answer & Explanation Answer: B) 3

Explanation:

National Hockey League game is divide into 3 Periods each of 20 minutes. During the regular season, if the game ends in a tie, a 5 minute, sudden death overtime is played. In the playoffs, the overtime is 20 minutes long.

Report Error

View Answer Report Error Discuss

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

12 2598
Q:

Where does hair not grow on the human body?

A) sole of feet B) palms
C) lips D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

Hair grows everywhere on the skin except palms, sole of feet and lips on the human body. Hair is modified type of skin.

where_does_hair_not_grow_on_the_human_body1544865865.jpg image

Report Error

View Answer Report Error Discuss

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

3 2597
Q:

Which of the following is known as the Electronic City of India?

A) Hyderabad B) Mumbai
C) Bengaluru D) Gurgaon
 
Answer & Explanation Answer: C) Bengaluru

Explanation:

Bengaluru city is known as the Electronic City of India. Because Electronic City is an IT hub in Anekal taluk of Bengaluru, Karnataka, India. It is one of India's largest electronic industrial parks in 3 phases i.e, in Konappana Agrahara and Doddathogur villages, Bengaluru.

Report Error

View Answer Report Error Discuss

3 2596
Q:

"Lona" is related to which game?

A) Kho Kho B) Kabbaddi
C) Lawn Tennis D) Badminton
 
Answer & Explanation Answer: B) Kabbaddi

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports
Exam Prep: Bank Exams

5 2596