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 3818
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 3817
Q:

' Crime and Punishment ' was written by

A) Alexander Solzhenitysn B) Lewis Carroll
C) Fyodor Dostoevsky D) Valdimir Nabakov
 
Answer & Explanation Answer: C) Fyodor Dostoevsky

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

2 3815
Q:

If length of a rectangle is decreased by 6 cm we get a square and the area of square formed is 252 cm2 less than the area of square formed when breadth of the original rectangle is increased by 6 cm. Find the perimeter of the rectangle.

A) 66 cm B) 88 cm
C) 80 cm D) 72 cm
 
Answer & Explanation Answer:

Explanation:

Let length and breadth of rectangle be L cm
and B cm respectively So, ATQ
Area1= (L-6)×B
But this is square, so L-6=B
Area1= (L-6) × (L-6)
Case 2, Area2= L × (B+6),
L=B+6
So, Area2= L × L,
Given, Area2-Area1= 252(L)2-(L-6)2=252
Solving this, L= 24
B= 18
Perimeter= 2(L+B)= 2(24+18)= 84 cm

Report Error

View Answer Report Error Discuss

3 3815
Q:

According to Forbes, Who has become Asia’s richest person in the year 2017?

A) Jeff Bezos B) Hui Ka Yan
C) Mukesh Ambani D) Bill Gates
 
Answer & Explanation Answer: C) Mukesh Ambani

Explanation:

Reliance Industries Chairman Mukesh Ambani overtook China’s Hui Ka Yan to become Asia’s richest person with a total wealth of $42.1 billion. According to Forbes’ real time billionaire’s list, Ambani's personal wealth rose by $466 million in 2017.

Report Error

View Answer Report Error Discuss

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

9 3815
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 3815
Q:

Which continent is known as white continent?

A) Antarctica B) Europe
C) Asia D) Africa
 
Answer & Explanation Answer: A) Antarctica

Explanation:

Antarctica is known as white continent because 98% of it's area is covered by ice throughout the year.

Report Error

View Answer Report Error Discuss

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

15 3814
Q:

Who among the following was the 1st Speaker of the Lok Sabha?

A) M.A. Ayyangar B) N. Sanjiva Reddy
C) Ganesh Vasudev Mavalankar D) Sardar Hukam Singh
 
Answer & Explanation Answer: C) Ganesh Vasudev Mavalankar

Explanation:

Ganesh Vasudev Mavalankar popularly known as Dadasaheb was an independence activist, the President of the Central Legislative Assembly, then Speaker of the Constituent Assembly of India, and later the first Speaker of the Lok Sabha, the lower house of the Parliament of India from 15 May 1952 – 27 February 1956.

the_1st_Speaker_of_the_Lok_Sabha1559041668.jpg image

Report Error

View Answer Report Error Discuss

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

4 3814