Search Placementyogi.com
 

Advanced Memory Allocation Management Objective Questions

  :: Topics ::

1

What is the output of program?

#include<stdio.h>
#include<stdlib.h>
#define ROW 3
#define COL 4
int main()
{
  int **p, i,j;
  p=(int**)malloc(ROW*sizeof(int*));

  for(i=0;i<ROW;i++)
   p[i]=(int*)malloc(COL*sizeof(int));


  for(i=0;i< ROW ; i++)
  {
    for(j=0;j<COL;j++)
   {
      p[i][j]=i;
   }
  }

  for(i=0;i< ROW ; i++)
  {
    for(j=0;j<COL;j++)
    {
       printf("%d",p[i][j]);
    }
    printf("\n");
  }

return 0;
}
A.

error: [] can not be used for pointer variable

B.

Some garbage value

C.

0000

1111

2222

D.

0123

0123

0123

See Answer & Explanation Lets Discuss
Correct answer is : C
Explanation

No explanation available. Let's Discuss

 
 

Banner to LogicGuns.com

Hide Page Information

C Memory Management or Allocation Objective Questions and Answers for Written Round Interview

Here you can find C Memory Management or Allocation Objective Questions with answers and explanation. We have a vast collection of Objective Questions on Memory Management or Allocation in C that will help you a lot!

Why learn C Memory Management or Allocation?

Memory Management or Allocation are an integral part of C and many Objective Questions in the written round are asked from this topic.In this section you can learn and practice C Memory Management or Allocation (Objective Questions with Answers) to improve your skills in order to face the interview and clear campus and off-campus selection of TCS, Infosys, Wipro etc.

Where can I get C Memory Management or Allocation Objective Questions and Answers with Explanation?

PlacementYogi provides you lots of fully solved C Memory Management or Allocation Objective Questions and answers with explanation. Fully solved examples with detailed answer description, explanation are given and it would be easy to understand.Though we do not have pdf file for C Memory Management or Allocation, We have quiz Objective Questions with answers to help you test yourself..

\n

Where can I get C Memory Management or Allocation Interview Objective Questions and Answers (objective type, multiple choice)?

Here you can find objective type C Memory Management or Allocation Objective Questions and answers for interview and entrance examination.Multiple Answers and true or false type Objective Questions are also provided.

How to solve C Memory Management or Allocation problems?

You can easily solve all kind of Objective Questions based on C Memory Management or Allocation by practicing the exercises (including shortcut Memory Management or Allocation to solve problems) given below.