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

Who is the author of ' The Accidental Prime Minister - The Making and Unmaking of Manmohan Singh'

Answer

Sanjaya Baru

Report Error

View answer Workspace Report Error Discuss

3 2655
Q:

One of the following companies does have business interest in both oil and shipping sectors. Identify this.

A) Tata Group B) Reliance Group
C) Essar Group D) ONGC
 
Answer & Explanation Answer: C) Essar Group

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

6 2655
Q:

Which chemical bond most likely stores the most energy?

A) Single bond B) Double bond
C) Both A & B D) None of the above
 
Answer & Explanation Answer: B) Double bond

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

1 2655
Q:

Refractive Index of glass with respect to water is

A) 4/3 B) 9/8
C) 2/3 D) 8/9
 
Answer & Explanation Answer: D) 8/9

Explanation:

Refractive Index of glass with respect to water can be calculated by 

(Refractive Index of glass with respect to air) × (1/Refractive Index of water with respect to air)

 

We know that,

Refractive Index of glass with respect to air = 4/3

Refractive index of water with respect to air = 3/2

 

Hence, Refractive Index of glass with respect to water = (4/3) x (2/3) = 8/9.

Report Error

View Answer Report Error Discuss

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

4 2655
Q:

Graphite is a good conductor of electricity.

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

Graphite is a good conductor of electricity as it contains free electrons to move through the structure of the graphite.

Report Error

View Answer Workspace Report Error Discuss

Subject: Physics
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO , IT Trainer

0 2654
Q:

Cricket is the national game of which country?

A) Australia B) India
C) Canada D) Spain
 
Answer & Explanation Answer: A) Australia

Explanation:

Cricket is the national game of Australia.

Report Error

View Answer Report Error Discuss

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

8 2654