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

Select the correct statement contrasting gametophytes and sporophytes.

A) Sporophytes are diploid, whereas gametophytes are haploid. B) Sporophytes are vascular, whereas gametophytes are nonvascular.
C) Sporophytes are larger than gametophytes. D) All of the above
 
Answer & Explanation Answer: A) Sporophytes are diploid, whereas gametophytes are haploid.

Explanation:

Sexual reproduction results in gametes that combine two cells from different individuals. Meiosis also produces gametes. Haploids contain one set of chromosomes in each of their cells. Diploids cells contain two chromosome sets. For plants, haploid and diploid cells divide via mitosis. The plants’ haploid phase is called the gametophyte, and the diploid phase is called the sporophyte.

 

Sporophytes are diploid plants that use meiosis to produce spores. These spores are haploid cells that grow into haploid gametophytes. Megaspores grow into female gametophytes, and microspores grow into male gametophytes.

 

Gametophytes are haploid plants that use mitosis to make haploid gametes. These gametes are female in the form of an ovum (egg) or male in the form of sperm.

Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: AIEEE

2 2895
Q:

Pain controlling chemicals in the body are called

A) Endorphins B) Neural regulators
C) Androgens D) Histamines
 
Answer & Explanation Answer: A) Endorphins

Explanation:

Endorphins are called pain controlling chemicals in the body.

Report Error

View Answer Report Error Discuss

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

3 2895
Q:

Font size is measured in

A) pixels B) points
C) didos D) percents
 
Answer & Explanation Answer: B) points

Explanation:

In computers, generally Font size is measured in points (pt).

Report Error

View Answer Report Error Discuss

Filed Under: Computer
Exam Prep: AIEEE , Bank Exams , CAT , GATE , GRE
Job Role: Analyst , Bank Clerk , Bank PO , Database Administration , IT Trainer

4 2894
Q:

General purpose utility gloves are

A) for surgeries B) for cleaning procedures
C) for handling tubes D) All of the above
 
Answer & Explanation Answer: B) for cleaning procedures

Explanation:

General purpose gloves - utility gloves are recommended for cleaning procedures, such as handling soiled linens or decontaminating care areas. Utility gloves are more tear and puncture resistant than other gloves.

utility_gloves1532521373.jpg image

Report Error

View Answer Report Error Discuss

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

1 2894
Q:

In e-FRRO, 'FRRO' stands for?

A) Foreigners Reacceptance Registration Office B) Foreigners Regional Registration Office
C) Foreigners Regaining Registration Office D) Foreigners Registry Registration Office
 
Answer & Explanation Answer: B) Foreigners Regional Registration Office

Explanation:

Home Minister Rajnath Singh launched the web-based application e-FRRO (e-Foreigners Regional Registration Office) scheme under which foreigners can avail, various visa and immigration-related services online. This will facilitate hassle-free travel to India for foreigners.

Report Error

View Answer Report Error Discuss

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

1 2894
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 2893