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

Head Quaters of NATO is located in 

A) Newyork B) Brussels
C) Alaska D) California
 
Answer & Explanation Answer: B) Brussels

Explanation:

Head Quaters of NATO is located in Brussels

Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

5 2655
Q:

Monopotassium tartarate was used in

A) Fertiliser B) Explosives
C) Photography D) Baking
 
Answer & Explanation Answer: D) Baking

Explanation:

Monopotassium tartarate was used in baking powder.

Report Error

View Answer Report Error Discuss

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

0 2655
Q:

Chemically marble is known as

A) Calcareous rock B) Siliceous Rock
C) Argillaceous Rock D) Metamorphic Rock
 
Answer & Explanation Answer: A) Calcareous rock

Explanation:

Chemically marble is known as Calcareous rock as it is composed of carbonate minerals like calcite or dolomite.

Report Error

View Answer Report Error Discuss

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

3 2654
Q:

Which one of the following is a search engine?

A) Bing B) Reddit
C) Pinterest D) Twitter
 
Answer & Explanation Answer: A) Bing

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2654
Q:

Air pressure is measured in which of the following units?

A) Steridian B) kg/mts
C) Newton D) Pascal
 
Answer & Explanation Answer: D) Pascal

Explanation:

Pressure = (Net Force) / (Applied area) = Newton / square meters


Measuring units of pressure are:

. Pascal
. Bar
. Torr
. Pounds per square inch (psi)
. Standard atmosphere (atm).

Report Error

View Answer Report Error Discuss

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

3 2653
Q:

How many Nucleotides make up a Codon?

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

Explanation:

3 Nucleotides make up a Codon. 

The nucleotide triplet that encodes an amino acid is called a codon.

Each group of three nucleotides encodes one amino acid.

Report Error

View Answer Report Error Discuss

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

6 2653