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

In which world cup cricket final, Australia beat England?

A) 1987, Kolkata - India B) 1996, Lahore - Pakistan
C) 1983, Lord's - England D) 1992, Melbourne - Australia
 
Answer & Explanation Answer: A) 1987, Kolkata - India

Explanation:

Australia won the 1987/88 Reliance World Cup against England held in Kolkata, India.

Report Error

View Answer Report Error Discuss

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

4 2892
Q:

Most highly intelligent mammals are

A) Elephants B) Kangaroos
C) Whales D) Dolphins
 
Answer & Explanation Answer: D) Dolphins

Explanation:

Dolphins are the most highly intelligent mammals.

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

9 2891
Q:

Organisms that depend only on raw plant products are said to be 

A) herbivorous B) vegetarian
C) carnivorous D) omnivorous
 
Answer & Explanation Answer: A) herbivorous

Explanation:

Herbivorous organisms are those that take for their food, plant parts like leaves raw in contrast to vegetarian, which means that plant products are taken raw or after being cooked.

Report Error

View Answer Report Error Discuss

Filed Under: Biology

3 2891
Q:

Which union territory is the capital of two states?

A) Chandigarh B) New Delhi
C) Chattisgarh D) Puducherry
 
Answer & Explanation Answer: A) Chandigarh

Explanation:

Which_union_territory_is_the_capital_of_two_states1538030603.jpg image

 

The city Chandigarh, being a union territory is the capital city of both Haryana and Punjab. As it is a union territory it is ruled directly by the central government and not by either states.

Report Error

View Answer Report Error Discuss

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

4 2891
Q:

Write a c program to create dos command type.

Answer

#include
int main( int count,char * argv[] ) {
    int i;
    FILE *ptr;
    char *str;
    char ch;
    if( count == 1) {


         printf( "The syntax of the command is incorrect.\n" );
    }
    for( i=1;i<cout;i++ ){
         ptr=fopen(argv[i],"r");
         if(ptr==NULL){
             printf("The system cannot find the file specified.");
             if(count>2)
                 printf("\nError occurred while procesing : %s.\n",argv[i]);
         }
         else {
             if(count>2) {
                 printf("%s\n\n",argv[i]);
             }
             while((ch=getc(ptr))!=-1)
                 printf("%c",ch);
         }
         fclose(ptr);
    }
    return 0;
}


 


Save the above file as open.c, compile and execute the go to command mode (current working directory) and write: open xy.c (xy.c any file present in that directory)
To run the open command in all directories and drive you will have to give the path of current working directory in command mode. Write:
C:tc\bin>PATH c:\tc\bin
Now press enter key. Now your open command will work in all directory and drive.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2890
Q:

Brainstorming is an example of

brainstorming_is_an_example_of1553165225.jpg image

A) Computer language B) Problem solving technique
C) Lightening effect D) None of the above
 
Answer & Explanation Answer: B) Problem solving technique

Explanation:

Brainstorming is an example of a problem solving technique of severe thinking.

Report Error

View Answer Report Error Discuss

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

3 2890
Q:

How many member countries are there in Shanghai Cooperation Organisation (SCO) ?

A) 5 B) 7
C) 6 D) 8
 
Answer & Explanation Answer: C) 6

Explanation:

There are six permanent members: China, Kazakhstan, Kyrgyzstan, Russia, Tajikistan, Uzbekistan. Soon India and Pakistan will also join it.

Report Error

View Answer Report Error Discuss

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

4 2889