LG Soft Placement Question Papers




LG Soft Placement Question Papers

Filed under:

LG Soft Placement Question Papers

1. main()
{
int i;
printf("%d", &i)+1;
scanf("%d", i)-1;
}

a. Runtime error.
b. Runtime error. Access violation.
c. Compile error. Illegal syntax
d. None of the above

2. main(int argc, char *argv[])
{
(main && argc) ? main(argc-1, NULL) : return 0;
}

a. Runtime error.
b. Compile error. Illegal syntax
c. Gets into Infinite loop
d. None of the above

3. main()
{
int i;
float *pf;
pf = (float *)&i;
*pf = 100.00;
printf("%d", i);
}

a. Runtime error.
b. 100
c. Some Integer not 100
d. None of the above

4. main()
{
int i = 0xff;
printf("%d", i< <2);
}

a. 4
b. 512
c. 1020
d. 1024

5. #define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}

a. 1
b. 225
c. 15
d. none of the above

6. union u
{
struct st
{
int i : 4;
int j : 4;
int k : 4;
int l;
}st;
int i;
}u;

main()
{
u.i = 100;
printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}

a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0

7. union u
{
union u
{
int i;
int j;
}a[10];
int b[10];
}u;

main()
{
printf("%d", sizeof(u));
printf("%d", sizeof(u.a));
printf("%d", sizeof(u.a[0].i));
}
a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0

8. main()
{
int (*functable[2])(char *format, …) ={printf, scanf};
int i = 100;

(*functable[0])("%d", i);
(*functable[1])("%d", i);
(*functable[1])("%d", i);
(*functable[0])("%d", &i);
}

a. 100, Runtime error.
b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number

9. main()
{
int i, j, *p;
i = 25;
j = 100;
p = &i; /* Address of i is assigned to pointer p */
printf("%f", i/(*p)); /* i is divided by pointer p */
}

a. Runtime error.
b. 1.00000
c. Compile error
d. 0.00000

10. main()
{
int i, j;
scanf("%d %d"+scanf("%d %d", &i, &j));
printf("%d %d", i, j);
}

a. Runtime error.
b. 0, 0
c. Compile error
d. the first two values entered by the user

11. main()
{
char *p = “hello world";
p[0] = ‘H’;
printf("%s", p);
}

a. Runtime error.
b. “Hello world” c. Compile error
d. “hello world”

12. main()
{
char * strA;
char * strB = “I am OK”; memcpy( strA, strB, 6);
}

a. Runtime error.
b. “I am OK” c. Compile error
d. “I am O”

13. How will you print % character?
a. printf(“%”) b. printf(“\%”) c. printf(“%%”) d. printf(“%%”)

14. const int perplexed = 2;
#define perplexed 3
main()
{
#ifdef perplexed
#undef perplexed
#define perplexed 4
#endif
printf(“%d”,perplexed); }

a. 0
b. 2
c. 4
d. none of the above

15. struct Foo
{
char *pName;
};

main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}

a. “Your Name” b. compile error
c. “Name” d. Runtime error

16. struct Foo
{
char *pName;
char *pAddress;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
obj->pName = malloc(100);
obj->pAddress = malloc(100);
strcpy(obj->pName,"Your Name");
strcpy(obj->pAddress, “Your Address");
free(obj);
printf("%s", obj->pName);
printf("%s", obj->pAddress);
}

a. “Your Name”, “Your Address” b. “Your Address”, “Your Address” c. “Your Name” “Your Name” d. None of the above

17. main()
{
char *a = “Hello “;
char *b = “World";
printf("%s", stract(a,b));
}

a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

18. main()
{
char *a = “Hello “;
char *b = “World";
printf("%s", strcpy(a,b));
}

a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

19. void func1(int (*a)[10])
{
printf("Ok it works");
}

void func2(int a[][10])
{
printf("Will this work?");
}

main()
{
int a[10][10];
func1(a);
func2(a);
}

a. “Ok it works” b. “Will this work?” c. “Ok it works Will this work?” d. None of the above

20. main()
{
printf("%d, %d", sizeof(’c'), sizeof(100));
}

a. 2, 2
b. 2, 100
c. 4, 100
d. 4, 4

21. main()
{
int i = 100;
printf("%d", sizeof(sizeof(i)));
}

a. 2
b. 100
c. 4
d. none of the above

22. main()
{
int c = 5;
printf("%d", main|c);
}

a. 1
b. 5
c. 0
d. none of the above

23. main()
{
char c;
int i = 456;
c = i;
printf("%d", c);
}

a. 456
b. -456
c. random number
d. none of the above

24. oid main ()
{
int x = 10;
printf ("x = %d, y = %d", x,–x++);
}

a. 10, 10
b. 10, 9
c. 10, 11
d. none of the above

25. main()
{
int i =10, j = 20;
printf("%d, %dn", j– , –i);
printf("%d, %dn", j++ , ++i);
}

a. 20, 10, 20, 10
b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10

26. main()
{
int x=5;
for(;x==0;x–) {
printf(“x=%dn”, x–); }
}
a. 4, 3, 2, 1, 0
b. 1, 2, 3, 4, 5
c. 0, 1, 2, 3, 4
d. none of the above

27. main()
{
int x=5;
for(;x!=0;x–) {
printf(“x=%dn”, x–); }
}
a. 5, 4, 3, 2,1
b. 4, 3, 2, 1, 0
c. 5, 3, 1
d. none of the above

28. main()
{
int x=5;
{
printf(“x=%d ”, x–); }
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. –3, -1, 1, 3, 5

29. main()
{
unsigned int bit=256;
printf(“%d”, bit); }
{
unsigned int bit=512;
printf(“%d”, bit); }
}

a. 256, 256
b. 512, 512
c. 256, 512
d. Compile error

30. main()
{
int i;
for(i=0;i<5;i++)
{
printf("%dn", 1L < < i);
}
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16

31. main()
{
signed int bit=512, i=5;

for(;i;i–)
{
printf("%dn", bit = (bit >> (i - (i -1))));
}
}
512, 256, 128, 64, 32
b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4

32. main()
{
signed int bit=512, i=5;

for(;i;i–)
{
printf("%dn", bit >> (i - (i -1)));
}
}

a. 512, 256, 0, 0, 0
b. 256, 256, 0, 0, 0
c. 512, 512, 512, 512, 512
d. 256, 256, 256, 256, 256

33. main()
{
if (!(1&&0))
{
printf("OK I am done.");
}
else
{
printf(“OK I am gone.”); }
}

a. OK I am done
b. OK I am gone
c. compile error
d. none of the above

34. main()
{
if ((1||0) && (0||1))
{
printf("OK I am done.");
}
else
{
printf(“OK I am gone.”); }
}

a. OK I am done
b. OK I am gone
c. compile error
d. none of the above

35. main()
{
signed int bit=512, mBit;

{
mBit = ~bit;
bit = bit & ~bit ;

printf("%d %d", bit, mBit);
}
}

a. 0, 0
b. 0, 513
c. 512, 0
d. 0, -513

Related Plament Papers and Companies

Hello Soft Placement Question Papers

Hello Soft Placement Question Papers Sample Question Paper 1.What is diners phylosophers algorithm. 2.What is atomicity.Explain 3. Give an example of source- level debugger in unix/linx. 4. What is Pre-emptive multitasking. 5. Do not remember this one. DataStructures 1. Where will the parameters be stored when a function is called in a program. 2. What is recursion?What are its disadvantages. 3. Which one is the best and efficient sort? Networking 1. ASN.1 belongs to which layer. 2. Give an example of popular Transport Layer Protocol 3. What is the netmask of Class B IP address? 4. Explain CSMA/CD. 5. Given a size from 0-7 what would be the least window size. C

Tata Elxsi

Tata Elxsi Placement Question Paper 1. nt a=9; switch(i) { printf("hello"); case 9 : printf("abc"); break; default : printf("def"); } what would be the output ? ans : the program will compile correctly with no errors but will give undesirable results 2. int z[3]={1,2,3}; int *p=&z[1]; int x=*p++; printf("%d",x); ans. note here that the value of *p will be assigned to x and then p is incremented therefore x=2 3. #define paste(a,b) a##b main() { int a=3,b=6; paste(a,b); return o; } question. what code will be replaced at the call of the macro options : (a,b) a,b (a,b) (ab) a,b (ab) (a,b) ab (a,b) ans. not able to work it out 4. some structure declaration was given struct abc { int a : 4 char

Honeywell

Honeywell Placement Question Papers Some sample Questions 1. What is a Real-Time System ? 2. What is the difference between Hard and Soft real-time systems ? 3. What is a mission critical system ? 4. What is the important aspect of a real-time system ? 5. Explain the difference between microkernel and macro kernel. 6. Give an example of microkernel.Why paging is used ? 7. Which is the best page replacement algo and Why ? 8. What is software life cycle ? 9. How much time is spent usually in each phases and why Which one do U want to

i SoftTech Placement Question Papers

i SoftTech Placement Question Papers 1.aptitute 25 Q's very easy 2.verbal 5 fill in the blanks,5synonyms,5 antonyms.. very easy for fill in the blanks ans is 1.d 2.d 3.d 4.a 5.d 3. Next c it contains 30 Q's plz follow the attachment be'coz all the Q's R repeated 2.G.D For me topic is "Is s/w professionals r paying more ? It's a fact or not? " 3.Interview Thats all be through the Q's ....... There cutoff is 50 out of 70.. C Question 1.a=5,b=3,c=a,b d=(a,b) printf(c,d) ans:c=5,d=3 2.e(int n) { if(n>0) { ...(not clear) printf("%d",n); e(--n); } return } ans:0,1,2,0 3.which has no problem with pointers int *f1() { int n; return (n) } int *f2() { int *p; *p=3; return p; } int *f3() { int *p; p=malloc(); return p; } ans:no error 4.header file ->contains declarations. 5.sizeof operator is executed during compile

PSI DATA SYSTEMS

PSI DATA SYSTEMS Placement Question Paper Birla Soft Sample Question Paper 1. Which of the following best explains life cycle of Defect ? a) Defect Found -> Defect Logged -> Defect Debugged -> Defect Closed -> Defect Rechecked b) Defect Found -> Defect Debugged -> Defect Reported -> Defect Rechecked -> DefectClosed c) Defect Debugged -> Defect Found -> Defect Closed -> Defect Reported -> DefectRechecked d) Defect Found -> Defect Logged -> Defect Debugged -> Defect Rechecked -> Defect Closed 2. Which group does Winrunner ,Load Runner ,SQA Suite fall under ? a) Databases b) Automated Test

  • Resources













  • Placement Papers Archives