Questions

Q:

How would you dynamically allocate a 2-D array of integers?

Answer

#include "alloc.h"


#define MAXROW 3


#define MAXcol 4


main()


{


        int *p, i, J;


        p = (int *) malloc (MAXROW * MAXCOL * sizeof (int));


         for ( i=0; i < MaxROW ; i++)


         {


                for (j=0; j < MAXCOL ; j++)


                { 


                      p [ i * MAXCOL + j] = i;


                       printf ( "%d", p [i * MAXCOL + j] );


                 }


                  printf ("\n");


          }


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3446
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 3444
Q:

Magnetic Tape can serve as

A) Input device B) Secondary storage device
C) Output device D) None of the above
 
Answer & Explanation Answer: B) Secondary storage device

Explanation:

Related image

Magnetic tape can serve as a Secondary storage unit. It is a medium for magnetic recording, made of a thin, magnetizable coating on a long, narrow strip of plastic film.

Report Error

View Answer Report Error Discuss

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

17 3444
Q:

The term 'Progeria' refers to which of the following ?

A) A natural satellite of planet jupiter B) A widely used Tuberculosis(TB) drug
C) A genetic disorder with symptoms of pre-mature aging D) None
 
Answer & Explanation Answer: C) A genetic disorder with symptoms of pre-mature aging

Explanation:

Progeria is a rare genetic disordr which involves symptoms resembloing aspects of aging, manifested at a very early age.
The term is often used in reference to Hutchinson - gilford progeria syndrome(HGPS).

Report Error

View Answer Report Error Discuss

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

1 3443
Q:

Point out which from the following is NOT a right enumerated in the Constitution of India but has been articulated by the Supreme Court to be a Fundamental Right

A) Right to privacy B) Certiorari
C) Abolition of untouchability D) Right to form association or Union
 
Answer & Explanation Answer: A) Right to privacy

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics

7 3442
Q:

What stops one branch of government from becoming too powerful?

A) State governments B) Every 4 years of President election
C) Members of congress D) Checks and Balances
 
Answer & Explanation Answer: D) Checks and Balances

Explanation:

A procedure or method called Checks and Balances stops one branch of government from becoming too powerful.

  • In the United States, there are three branches of government: The Executive, Legislative, and Judicial.

 

  • Each has its own responsibilities and at the same time they work together to make the country run smoothly and to assure that the rights of citizens are not ignored or disallowed.

 

  • There is a clear separation of powers between them.

 

  • Checks and Balances limit the power within each branch.

 

  • Each branch can stop and/or override processes within other branches in manners that are outlined in federal laws, regulations, and the constitution.

 

  • This way, their powers are balanced because the branches of government have the responsibility to check each other.
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

7 3442
Q:

Which one of the following is an abiotic and renewable resource

A) Iron ore B) Livestock
C) Water D) Forests
 
Answer & Explanation Answer: C) Water

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

2 3441
Q:

If people sleep in closed rooms where charcoal fire is burning , they die due to 

A) carbon monoxide B) carbon dioxide
C) methane D) phosgene
 
Answer & Explanation Answer: A) carbon monoxide

Explanation:

A closed room is aplace where charcoal is burnt in limited supply of air. There is every chance for the formation of the deadly poisonous carbon monoxide, which when inhaled, reacts with the iron in haemoglobin of blood and prevents the supply of oxygen. It is said to be treacherous as there can be no previous warning of its presence because it is an odourless and colourless gas.

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

2 3441