-->



Honeywell Placement Paper


1. How to allocate memory for 10 integers and make the contents zero?
ans : ptr= calloc(10, int value);

2. what will be the output?
void increment()
{
return x++;
}

for(x=0;x<10;increment())
{
some operation;
}


3. How to free the allocated memory?
Ans : free();

4. How to initialize constant pointer?

5. what is the output?
int modifycalue()
{
x=x+10;
}

int changevalue(x)
{
x=x+1;
}

void main()
{
int x=10;
changevalue(x);
x++;
printf("%d", x);
x++;
printf("%d", x);
modifyvalue();
printf("%d", x);
}

Ans : 11, 12, 12

The above question is 90% reproduced here

6.how to free the node in linked list in a for loop....

7. x=0;
while(x<10)
{
stmt;
x++;
}
8)Find string palindrome

9)Write a C function to search a number in the given list of numbers. do not use printf and scanf

10)What is the difference between delete, drop, truncate?

11)what is out put of the following code?
#include
class Base
{
Base()
{
cout<<"constructor base";
}
~Base()
{
cout<<"destructor base";
}
}
class Derived:public Base
{
Derived()
{
cout<<"constructor derived";
}
~Derived()
{
cout<<"destructor derived";
}
}
void main()
{
Base *var=new Derived();
delete var;
}