Questions

Q:

_________ is known as the Queen of the Arabian Sea?

A) Cochin B) Mumbai
C) Mangalore D) Surat
 
Answer & Explanation Answer: A) Cochin

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography

10 4080
Q:

How would you use qsort() function to sort an array of structures?

Answer

#include "string.h"


#include "stdlib.h"


struct stud


{


       int rollno;


       int marks;


       char name[30];


};


int sort_m (struct stud *, struct stud *);


int sort_name (struct stud *, struct stud *);


int sort_marks (struct stud *, struct stud *);


 


main()


{


static struct stud ss[] = {


                                            { 15, 96, "Akshay" },


                                            { 2, 97, "Madhuri" },


                                            { 8, 85, "Aishvarya" },


                                            { 10, 80, "Sushmita" }


                                   };


int x,w;


clrscr();


w = sizeof (struct stud);


 


printf ('\nIn order of roll numbers:");


qsort (ss, 4, w, sort_rn);


for(x=0; x<4;x++)


     printf ("\n%d%s%d", ss[x].rollno, ss[x].name,ss[x].marks);


 


printf("\n\nIn order of names:");


qsort(ss, 4, sort_name);


 


for (x=0; x<4;x++)


      printf("\n%d%s%d",ss[x].rollno, ss[x].name,ss[x].marks);


printf("\n\nIn order of marks:");


qsort(ss,4,w,sort_marks);


 


for (x=0;x<4;x++)


      printf ("\n%d%s%d",ss[x].rollno,ss[x].name,ss[x].marks);


}


int sort_rn (struct stud *t1, struct stud *t2)


{


     return (t1->rollno-t2->rollno);


}


 


int sort_name (struct stud *t1, struct stud *t2)


{


     return (strcmp(t1->name,t2->name));


}


int sort_marks (struct stud *t1, struct stud *t2)


{


     return (t2->marks-t1->marks);


}


 


 


 

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 4080
Q:

Which river has no mention in Rigaveda

A) Sindhu B) Saraswati
C) Yamuna D) Periyar
 
Answer & Explanation Answer: D) Periyar

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

2 4079
Q:

World Health Day is observed on ________

A) April 7 B) April 14
C) April 21 D) April 28
 
Answer & Explanation Answer: A) April 7

Explanation:
Report Error

View Answer Report Error Discuss

23 4079
Q:

Which of the following is a Project to develop watersheds in India?

A) DRDO B) CARE
C) AVARD D) NWDPRA
 
Answer & Explanation Answer: C) AVARD

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams
Job Role: Bank PO

5 4077
Q:

In Which Indian state is the world's highest cricket ground located ?

A) Himachal Pradesh B) Uttarakhand
C) West Bengal D) Jammu Kashmir
 
Answer & Explanation Answer: A) Himachal Pradesh

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

11 4076
Q:

Round as a Dishpan, Deep as a Tub and Still the Oceans could not fill it up. What is it?

A) Bath Tub B) A plug hole
C) Sieve D) None
 
Answer & Explanation Answer: C) Sieve

Explanation:

Sieve.

A utensil consisting of a wire or plastic mesh held in a frame, used for straining solids from liquids.

Report Error

View Answer Report Error Discuss

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

9 4076
Q:

Customer Perceptions and Business Outcomes help to define what ?

A) Key Performance Indicators (KPI's) B) Service Value
C) Total Cost of Ownership (TCO) D) Governance
 
Answer & Explanation Answer: B) Service Value

Explanation:
Report Error

View Answer Report Error Discuss

6 4076