Questions

Q:

What is the capital of Hungary?

A) Budapest B) Reykjavik
C) Santo Domingo D) None
 
Answer & Explanation Answer: A) Budapest

Explanation:

Budapest is the capital of Hungary

Report Error

View Answer Report Error Discuss

Filed Under: Country Capitals

13 4187
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 4187
Q:

Atomic weight of an element is given by

A) sum of neutrons and electrons B) sum of neutrons and protons
C) only neutrons D) only protons
 
Answer & Explanation Answer: A) sum of neutrons and electrons

Explanation:

Atomic weight=number of neutrons+number of protons

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

7 4187
Q:

Which country has been unanimously elected as the President of the UN-Habitat  ?

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

Explanation:

India has been unanimously elected as the President of the UN-Habitat. UN-Habitat, an organ of the United Nations’ Organisation (UNO) reports to the United Nations General Assembly. UN-Habitat  promotes socially and environmentally sustainable human settlements across the world. India has been elected as the President of UN-Habitat after a gap of 10 years. This is only the third time that India has been elected as the President of UN-Habitat after 2007 and 1988. The UN-Habitat was established in 1978.

Report Error

View Answer Report Error Discuss

Filed Under: World Organisations
Exam Prep: Bank Exams , CAT , GATE

7 4186
Q:

What is the official language of African Export and import Bank

A) Egypt B) Senegal
C) Dauber D) None of these
 
Answer & Explanation Answer: A) Egypt

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

4 4183
Q:

Difference between Candidate key and Primary key?

Answer

Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key. 


Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.






        • One needs to be very careful in selecting the Primary Key as an incorrect selection can adversely impact the database architect and future normalization. For a Candidate Key to qualify as a Primary Key, it should be Non-NULL and unique in any domain.




Report Error

View answer Workspace Report Error Discuss

6 4181
Q:

Which method of expressing direction is indicated in the illustration?

A) Section B) Interjuction
C) Intersection D) None of the above
 
Answer & Explanation Answer: C) Intersection

Explanation:

Which_method_of_expressing_direction_is_indicated_in_the_illustration1556259373.png image

 

Intersection method of expressing direction is indicated in the illustration.

Report Error

View Answer Report Error Discuss

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

5 4180
Q:

What is the name for the process that is used to convert a series of instructions or programs, written in a high-level language into instructions(or a program) that can be run on a computer? 

A) Assembling B) Compiling
C) Translating D) Uploading
 
Answer & Explanation Answer: B) Compiling

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Computer
Exam Prep: Bank Exams
Job Role: Bank Clerk

7 4179