Questions

Q:

What will be output of following c code?

void main()
{
struct bitfield
{
unsigned a:5;
unsigned c:5;
unsigned b:6;

}bit;
char *p;
struct bitfield *ptr,bit1={1,3,3};
p=&bit1;
p++;
clrscr();
printf("%d",*p);
getch();
}

Answer

Output: 12

Explanation:
Binary value of a=1 is 00001 (in 5 bit)
Binary value of b=3 is 00011 (in 5 bit)
Binary value of c=3 is 000011 (in 6 bit)

In memory it is represented as:
Let address of bit1 is 500 which initialize to char pointer p. Since can is one byte data type so p++ will be 501. *p means content of memory location 501 which is (00001100) and its binary equivalent is 12. Hence output is 12.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3509
Q:

National Dairy Research Institute is located at

A) Ludhiana B) Karnal
C) Pantnagar D) Hyderabad
 
Answer & Explanation Answer: B) Karnal

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

4 3509
Q:

Cortisol is secreted by

A) Thyroid gland B) Pituitary gland
C) Adrenal gland D) Parathyroid gland
 
Answer & Explanation Answer: C) Adrenal gland

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

6 3509
Q:

Who is the author of the book "The Alchemist"?

A) Agatha Christie B) Paulo Ceolho
C) Frankenstien D) None
 
Answer & Explanation Answer: B) Paulo Ceolho

Explanation:

Paulo Ceolho is the author of The Alchemist

Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

2 3508
Q:

Which of the following is regarded by historians as a crucial stage in describing the progress of civilization?

A) Writing B) The discovery of fire
C) Agriculture D) The use of internet
 
Answer & Explanation Answer: C) Agriculture

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

3 3508
Q:

Which of the following has become the first country to grant citizenship to a Robot ?

A) Saudi Arabia B) New Zealand
C) China D) Japan
 
Answer & Explanation Answer: A) Saudi Arabia

Explanation:
Report Error

View Answer Report Error Discuss

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

10 3508
Q:

Borobudur Temple in Magelang is located in which country? 

A) Indonesia B) Iran
C) Bangladesh D) Laos
 
Answer & Explanation Answer: A) Indonesia

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Places

5 3507
Q:

Which of the following is malleable?

A) Ice B) Gold
C) Stone D) Pottery
 
Answer & Explanation Answer: B) Gold

Explanation:

Here in the given options, Gold is a malleable substance.

Malleable substance means a metal or a material able to be hammered or pressed into shape without breaking or cracking. i.e, tensile.

Report Error

View Answer Report Error Discuss

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

2 3507