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

Which company's name in Italian means 'to roll'?

A) Vauxhall B) Honda
C) Volvo D) Michelin
 
Answer & Explanation Answer: C) Volvo

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

12 3823
Q:

Which day is celebrated by United Nations Educational, Scientific and Cultural Organization (UNESCO) on May 3 ?

A) World Press Freedom Day B) World Health Day B. CD.
C) International Yoga Day D) World Malaria Day
 
Answer & Explanation Answer: A) World Press Freedom Day

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Important Days and Years
Exam Prep: Bank Exams , CAT
Job Role: Bank PO

2 3823
Q:

Which country has recently become fifth largest military spender  ?

A) India B) Japan
C) China D) Russia
 
Answer & Explanation Answer: A) India

Explanation:

1. India's military expenditure grew around 8.5 percent in 2016, making it the world's fifth largest spender at $55.9 billion, figures released by the Stockholm International Peace Research Institute (SIPRI).

2. As per the figures, the US remains the world's largest military spender registering a growth of 1.7 percent between 2015 and 2016 to $611 billion.

3. China is second and Russia is on the third position in the list.

Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

8 3823
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 3822
Q:

A manometer is used to measure

A) earthquake B) pressure
C) temperature D) density
 
Answer & Explanation Answer: B) pressure

Explanation:

A manometer is used to measure a pressure difference between two points.

a_manometer_is_used_to_measure1553165853.png image

Report Error

View Answer Report Error Discuss

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

7 3821
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 3820
Q:

Who wrote the Book "A Tale of Two Cities"

A) William Shakespeare B) Jane Austen
C) Leo Tolstoy D) Charles Dickens
 
Answer & Explanation Answer: D) Charles Dickens

Explanation:

A Tale of Two Cities, which is one of two historical novels written by Charles Dickens, is set in London and in Paris and the French countryside at the time of the French Revolution.

Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

13 3820