Questions

Q:

Main memory works in conjunction with

A) CPU B) Intel
C) RAM D) Special function cards
 
Answer & Explanation Answer: A) CPU

Explanation:

Main memory works in conjunction with CPU.

Report Error

View Answer Report Error Discuss

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

8 4150
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 4149
Q:

Who invented Fountain Pen?

A) Sir Frank Whittle B) John J. Loud
C) Kirkpatrick Macmillan D) Lewis E. Waterman
 
Answer & Explanation Answer: D) Lewis E. Waterman

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Inventions

1 4149
Q:

Which is longest railway station ?

Answer

Grand Central Terminal, Chicago(USA).

Report Error

View answer Workspace Report Error Discuss

15 4147
Q:

What was the name of India's first ever micro-drama festival that was held recently in New Delhi ?

A) Thanes Hare B) Taapsi
C) Thespis D) Ankulrama
 
Answer & Explanation Answer: C) Thespis

Explanation:

India's first ever micro-drama festival, named Thespis, was held recently in New Delhi. 

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

2 4145
Q:

The famous song ‘Saare Jaha se Achha’ is composed by ___________

A) Ravindra Nath Tagore B) Bankim Chandra Chattopadhya
C) Mohammad Iqbal D) one of the above
 
Answer & Explanation Answer: C) Mohammad Iqbal

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Culture

53 4144
Q:

Harsha was defeated  by 

A) Sasanka B) King of Valabhi
C) Bhaskarvarman D) Pulkesin II
 
Answer & Explanation Answer: D) Pulkesin II

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

5 4143
Q:

Who gave the slogan Bharat Chhodo during the Quit India movement?

A) Gandhi B) Yusuf Meher Ali
C) Nehru D) Aruna Asif Ali
 
Answer & Explanation Answer: A) Gandhi

Explanation:

Mohandas Karamchand Gandhi gave the slogan Bharat Chhodo during the Quit India movement.

Report Error

View Answer Report Error Discuss

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

20 4142