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

Virginia is a place in U.S.A. famous for growing _____ .

A) Weed B) Cannabis
C) Tobacco D) None of the above
 
Answer & Explanation Answer: C) Tobacco

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Places

3 3785
Q:

The first martyrdom in Sikh history in the reign of Jehangir was of

A) Guru Ram Das B) Guru Teg Bahadur
C) Guru Angad D) Guru Arjan
 
Answer & Explanation Answer: D) Guru Arjan

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

1 3785
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 3784
Q:

What ‘game’ was first produced by the Southern Novelty Company in Baltimore, Maryland in 1892?

A) Frisbee B) Monopoly
C) Ouija board D) Ping Pong
 
Answer & Explanation Answer: C) Ouija board

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Inventions

1 3783
Q:

Dimond is

A) an element B) a compound
C) a mixture D) a liquid
 
Answer & Explanation Answer: A) an element

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

3 3781
Q:

In India, Salt Lake City is located in

A) West Bangal B) Rajastan
C) Gujarat D) Delhi
 
Answer & Explanation Answer: A) West Bangal

Explanation:

BidhanNagar in Kolkata, West Bangal is popularly known as Salt Lake City.

Report Error

View Answer Report Error Discuss

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

18 3780
Q:

The Famous personality best known for the instrument Tabla  ?

A) Bundu Khan B) Zakir Hussain
C) P. Mani Iyer D) Ravi Sankar
 
Answer & Explanation Answer: B) Zakir Hussain

Explanation:

Zakir Hussain is best known for the instrument Tabla.

Bundu Khan is known for Sarangi

P. Mani Iyer is known for Mridangam

Ravi Sankar is known for Sitar

Report Error

View Answer Report Error Discuss

Filed Under: Famous Personalities
Exam Prep: Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

4 3780