Vous êtes sur la page 1sur 4

This article tries to document the questions that were a part of written exam conducted by Samsung India Software.

The document only captures the type of question asked and does not contain the accurate question. The objective is
discuss the logic behind each question. The paper consists of 3 sections , the first section consists of C programming
question the second section was of embedded and third section was of telecom basics.

Section 1 C programming

Ques 1. Which loop is always executed at least once?


Ans 1. Do ... while loop.

Ques 2. Given a program

int main
{
int x =4 ;
int y = 5;

x = y++ + x++;
y = ++x + ++y;

printf(“x = %d, y = %d”, x,y);


}

Output of the program will be ?

Ans 2. x = 12, y = 20

Ques 3. The declaration for an array of 10 function pointers returning void* and taking no argument is ?
Ans 3. void* (*pfunct)()[10];

Ques 4. The declaration for a pointer to an array of integer pointers is ?


Ans 4.

Ques 5. Given a program


http://www.chetanasforum.com/index.php?showtopic=8314
int main()
{
struct example {
int temp_i;
int temp_j;
};

struct example q, *pq;


temp_i = 10;

pq = &q;
q.temp_i = 11;
q.temp_j = 12;

printf(“%d”,(*pq).temp_i);
}

Output of the program will be ?

1. 11
2. Memory location of the member variable temp_i
3. 10
4. Error

Ans 5. 11

Ques 6. Given a program

Int main()
{
char *p = “One”,”Two”;
char *q= (“One”,”Two”);

printf(“%s %s”,p,q);

Output of the program will be

1. Two One
2. One One
3. One Two One Two

Ans 6.

Ques 7. Assuming a 32 bit aligned machine the size of the following structure will be.

struct example {
char a;
int b;
float c;
short d;
};

Ans 7. 16

Ques 8. Given the following program

int main ()
{
struct example {
union {
int a:8;
int b:8;
int c:8;
int d:8
}

int x;
}p;

p.x = 0xAABBCCDD;

printf(“%x%x%x%x”,p.a&&0xFF, p.b&&0xFF, p.c&&0xFF, p.d&&0xFF);


}

Output of the program will be


1. AABBCCDD
2. DDCCAABB
3. AACCBBDD
4. DDCCAABB

Ans 8.

Ques 9. Declaration of a function pointer returning void and taking int as argument is
Ans 9. void (*pfn)(int)

Ques 10. Give the value of x=3 and y=6 the output of the following program will

x=x^y
y =y^x
x=x^y

Ans 10. x = 6 y = 3

Ques 11. Given a program

int main()
{
char a[] = “C Programming”;
char *p = “C Programming”;

printf(“%c %c”,*a[0],

Ans 11.

Ques 12. Given a program

#define Str(x) #x
#define Op(x) Str(x)
#define

int main()
{
Op(plus);
}

Output of the program will be

Ans 12. “Plus”

Ques 13.

typedef union {
union {
int a;
int b;
int c;
}

union{
char x;
char y;
char z;
}

union{
}
}

Size of the union will be

Ans 13. 6

Ques 14. Which operation is not allowed on _register

1. *
2. &
3. Both

Ans 14. Both

Vous aimerez peut-être aussi