Questions

Q:

What would be the output of the following program?

main()

{

   struct emp

   {

        char *n;

        int age;

   };

   struct emp e1 = { "Dravid", 23};

   struct emp e2 = e1;

   strupr (e2.n);

   printf ("\n%s",e1.n);

}

Answer

DRAVID


When a structure is assigned, passed, or returned, the copying is done monolithically. This means that the copies of any pointer fields will point to the same place as the original. In other words, anything pointed to is not copied. Hence, on changing the name through e2.n it automatically changed e1.n

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2676
Q:

Write a c program for binary search.

Answer

#include<stdio.h>
int main(){

    int a[10],i,n,m,c=0,l,u,mid;

    printf("Enter the size of an array: ");
    scanf("%d",&n);

    printf("Enter the elements in ascending order: ");
    for(i=0;i<n;i++){
         scanf("%d",&a[i]);
    }

    printf("Enter the number to be search: ");
    scanf("%d",&m);

    l=0,u=n-1;
    while(l<=u){
         mid=(l+u)/2;
         if(m==a[mid]){
             c=1;
             break;
         }
         else if(m<a[mid]){
             u=mid-1;
         }
         else
             l=mid+1;
    }
    if(c==0)
         printf("The number is not found.");
    else
         printf("The number is found.");

    return 0;
}

Sample output:
Enter the size of an array: 5
Enter the elements in ascending order: 4 7 8 11 21
Enter the number to be search: 11
The number is found.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2676
Q:

Which of the following is not a video file extension?

A) .flv B) .mov
C) .mp3 D) None of the above
 
Answer & Explanation Answer: C) .mp3

Explanation:

.mp3 is audio file extension.

Report Error

View Answer Report Error Discuss

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

6 2676
Q:

What is the name of the Indian Coast Guard Ship which has been decommissioned by the Indian navy recently ?

A) Sarathi B) Shaurya
C) Varuna D) Ayush
 
Answer & Explanation Answer: C) Varuna

Explanation:
Report Error

View Answer Report Error Discuss

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

5 2675
Q:

Which can disrupt the cell cycle?

A) Mutation B) Replication
C) Both A & B D) None of the above
 
Answer & Explanation Answer: D) None of the above

Explanation:

Mutations can disrupt the cell cycle, and can cause certain diseases and conditions.

Report Error

View Answer Report Error Discuss

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

2 2675
Q:

Which of these statements is true of the kingdom protista?

A) All are unicellular B) All are hetertrophic
C) All are autotrophic D) All are eukaryotic
 
Answer & Explanation Answer: D) All are eukaryotic

Explanation:

Protists are eukaryotic organisms that cannot be classified as a plant, animal, or fungus. They are mostly unicellular, but some, like algae, are multicellular.

which_of_these_statements_is_true_of_the_kingdom_protista1536211148.jpg image

Kelp, or 'seaweed,' is a large multicellular protist that provides food, shelter, and oxygen for numerous underwater ecosystems.

Report Error

View Answer Report Error Discuss

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

1 2674
Q:

Bleaching powder is used in drinking water as

A) Disinfectant B) Antibiotic
C) Coagulant D) Antiseptic
 
Answer & Explanation Answer: A) Disinfectant

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2673
Q:

The Nobel Prize in Economics was started in

A) 1901 B) 1936
C) 1957 D) 1967
 
Answer & Explanation Answer: D) 1967

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

4 2673