Saturday 28 February 2015

VALUE LABS

VALUE LABS WRITTEN TEST QUESTIONS

SYLLABUS:C,C++,LINUX,TCP/IP

15 THEORETICAL QUESTIONS TIME:1HR 30MIN

Some questions are 3 marks and some are 2marks

1)In an unsorted linked list write a C program to make list as even no.s one side and odd no.s another side.
ex:17,15,8,12,10,5,4,1
make the list as
8,12,10,4,17,15,5,1

2)Write a C program to permute a string "abc" in all possible ways and print them.

3)Write a C program to add 2 no.s with out using any operator.

4)a)what is host byte order,network byte order?
b)what is multicast,unicast,broadcast?
c)Is broadcast possible in TCP?Explain with an example.

5)Write a C program with out using free function deallocate the memory.

6)In Double Linked List
a)insert a node in sorted order
b)move to end of the list and add a node
c)delete a specific node from the list

7)a)what is operator overloading explain with an example.
b)what do u mean by deep copy & shallow copy,explain with an example.

8)what is the significance if _vptr and virtual table.

9)when does stack winding and stack winding happens.explain with an example.

10)In a integer no. there is only one binary 1 remaining all are 0's.Then write a C program to find the position of that binary 1.

11)a)write the output for
main()
{
char *ptr="linux"
printf("\n[%c]\n",*ptr++);
printf("\n[%c]\n",*ptr);
}

b)change the program to get correct answere

int* inc(int n)
{
int a=n;
++a;
return(&a);
}

main()
{
int *val,a=10;
val=inc(a);
printf("value is %d",*val);
}

12)what is the output for
printf("%d");

13)what is the benefit of using enum and #define with constant.Explain with an example.

14)what is re-entrant function.Explain with an example.

15)Write a program to modify the constant value.