Questions

Q:

How would you check whether the contents of two structure variables are same or not?

Answer

struct emp


{


     char n[20];


      int age;


};


main()


{


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


   struct emp e2;


   scanf ("%s %d",e2.n, & e2.age);


   if( structcmp (e1,e2) ==0)


        printf ("The structures are equal");


   else


         printf ("The structures are unequal");


}


structcmp ( struct emp x, struct emp y)


{


     if (strcmp (x.n,y.n) ==0)


           if (x.age == y.age)


            return (0);


            return (1);


}


In short, if you nee to compare two structures, you'll have to write your own function to do so which carries out the comparison field by field.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3794
Q:

What is the capital of Peru?

A) Warsaw B) Lima
C) Dakar D) Victoria
 
Answer & Explanation Answer: B) Lima

Explanation:

Lima is the capital of Peru

Report Error

View Answer Report Error Discuss

Filed Under: Country Capitals

10 3793
Q:

Which is the best description of civil liberties?

A) privileges B) rights guaranteed by law
C) natural rights D) democratic goals
 
Answer & Explanation Answer: B) rights guaranteed by law

Explanation:

Rights guaranteed by law, is the best description of Civil liberties.

 

Which_is_the_best_description_of_civil_liberties1557485778.png image 

 

Civil liberties are also called as personal freedoms. They are personal guarantees and freedoms that the government cannot abridge, either by law or by judicial interpretation, without due process.

 

 

Report Error

View Answer Report Error Discuss

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

7 3793
Q:

' In CUstody ' , an english novels, is written by which one of the following

A) Vikram Seth B) Shoba De
C) Anita Desai D) VS.Naipaul
 
Answer & Explanation Answer: C) Anita Desai

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

4 3792
Q:

Which among the following are the components of windows registry?

A) Keys B) SubKeys
C) Values D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

All the above listed are the components of Windows registry

Report Error

View Answer Report Error Discuss

Filed Under: Operating Systems

0 3792
Q:

Which of the following layers of the earth is believed to have the heavist mineral materials of highest density

A) Central core B) Crust
C) Mantle D) Both (B) and (C)
 
Answer & Explanation Answer: A) Central core

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

0 3792
Q:

Which team did Sachin Tendulkar paly for in the Ranji Trophy when he made his debut in first class cricket

A) Karnataka B) Delhi
C) Mumbai D) kerala
 
Answer & Explanation Answer: C) Mumbai

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports

2 3791
Q:

Buoyancy depends on

A) the mass of the liquid displaced B) the mass of the body
C) the depth to which the body is immersed D) the shaped of the body
 
Answer & Explanation Answer: A) the mass of the liquid displaced

Explanation:

Buoyancy or Upthrust, is an upward force exerted by a fluid that opposes the weight of an immersed object.

In a column of fluid, pressure increases with depth as a result of the weight of the overlying fluid.

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: AIEEE , GATE
Job Role: Analyst

8 3791