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

Name one problem that led to the civil war.

A) Slavery B) Economic reasons
C) State's Rights D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:
Report Error

View Answer Report Error Discuss

0 2686
Q:

Support staff in the office of the president include

A) Repoters B) Cabinet members
C) Administrators D) All of the above
 
Answer & Explanation Answer: C) Administrators

Explanation:

Support staff in the office of the president include Administrators.

Support_staff_in_the_office_of_the_president_include1539257220.jpg image

Report Error

View Answer Report Error Discuss

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

1 2686
Q:

Which color has the highest energy?

A) Violet B) Red
C) Blue D) White
 
Answer & Explanation Answer: A) Violet

Explanation:

Violet colour has the highest energy. The higher the frequency, the faster the oscillations and thus the higher the energy. Therefore, the highest-frequency ultra-violet light or the lowest wavelength is violet.

Report Error

View Answer Report Error Discuss

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

5 2685
Q:

How many tentacles does an octopus have?

A) 9 B) 8
C) 3 D) 0
 
Answer & Explanation Answer: B) 8

Explanation:

An octopus have 3 hearts, 9 brains and 8 tentacles.

how_many_tentacles_does_an_octopus_have1546856090.jpg image

Report Error

View Answer Report Error Discuss

Filed Under: Animals and Birds
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk , Bank PO

5 2685
Q:

What is virtual channel?

Answer

Virtual channel is normally a connection from one source to one destination, although multicast connections are also permitted. The other name for virtual channel is virtual circuit.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

0 2685
Q:

When insulin is released, it causes

A) Amount of glucose in blood decreases B) Amount of glucose in blood increases
C) Amount of bile juice increases D) Amount of bile juice decreases
 
Answer & Explanation Answer: A) Amount of glucose in blood decreases

Explanation:

We know that, when we eat a meal, any carbohydrates we've eaten are broken down into glucose and passed into the bloodstream. This rise in blood glucose causes insulin to be released from the pancreas so glucose can move inside the cells and be used. As glucose moves inside the cells, the amount of glucose in the bloodstream returns to normal and insulin release slows down.

Report Error

View Answer Report Error Discuss

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

3 2685
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 2684