.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Samsung Placement Papers » Samsung Previous Year Placement Paper

 

Samsung Placement Paper -: Data Structures and Algorithms Questions With Answers


Advertisements
Advertisements




Samsung Previous Years Solved Sample Placement Papers

  1. If `abc` is the input, then the following program fragment:
    `char x, y, z; printf("%d", scanf("%c%c%c", &x, &y, &z));`
    Results in:

    (a) A syntax error

    (b) A fatal error

    (c) Segmentation violation

    (d) Printing of 3 Answer: Option D

  2. Solution: The `scanf` function successfully reads three characters and returns 3, indicating the number of inputs processed.
  3. Consider the statements:
    `putchar(getchar()); putchar(getchar());`
    If `ab` is the input, the output will be:

    (a) An error message

    (b) This can’t be input

    (c) ab

    (d) a b Answer: Option C

  4. Solution: The first `getchar` reads 'a', and the second `getchar` reads 'b', which are printed in sequence.
  5. The operators `.`, `||`, `<`, `=` arranged in ascending order of precedence:

    (a) ., ||, <, =

    (b) =, <, ||, .

    (c) =, ||, <, .

    (d) <, ||, =, . Answer: Option A

  6. Solution: Operator precedence in C dictates that `.` has the highest precedence, followed by `<`, `||`, and `=`.
  7. The following program fragment:
    `unsigned i = -1; int j = -4; printf("%u", i + j);`
    Prints:

    (a) Garbage

    (b) -3

    (c) An integer that changes from machine to machine

    (d) None of the above Answer: Option A

  8. Solution: The value of `-1` is interpreted as the maximum value of an unsigned integer, causing undefined behavior and garbage output.
  9. The following program fragment:
    `for (i = 3; i < 15; i += 3); printf("%d", i);`
    Results in:

    (a) A syntax error

    (b) An execution error

    (c) Printing of 12

    (d) Printing of 15 Answer: Option D

  10. Solution: The loop increments `i` to 15, exiting the loop, and prints the final value of `i` as 15.
  11. In the following program, identify the incorrect statement:
    `int main(void) { int i = 100; int *pi = &i; int **dpi = pi; }`

    (a) dpi to store a pointer with the address for pi is a double pointer

    (b) (*pi == i) is true.

    (c) (*pi == **dpi) is true.

    (d) (*dpi == 100) is true Answer: Option D

  12. Solution: `(*dpi)` is expected to point to the address of `pi`, not the value 100. Hence, Option D is incorrect.
  13. Consider the following program fragment:
    `int counter = 0, i; for (i = 0;; i++) { if (i < 100) continue; counter++; if (counter == 100) break; } printf("%d %d", i, counter);`
    Results in:

    (a) 199 100

    (b) 200 100

    (c) 199 99

    (d) 200 0 Answer: Option A

  14. Solution: The loop iterates until `i` is 199 and `counter` reaches 100, making the output `199 100`.
  15. Consider the array definition:
    `int a[] = {10, 20, 30, 40};`
    Identify the incorrect statement:

    (a) Successive one-dimensional array elements in the array a[1], a[2] are located in contiguous memory space.

    (b) a[1] and *(a+1) are the same.

    (c) During initialization, array size must be specified; otherwise, a compile-time error occurs.

    (d) &a[1] which has a+1 value, such as the address Answer: Option C

  16. Solution: An array can be initialized without specifying its size explicitly, as the size is inferred from the initializer.
  17. Define `sqrt(x) x*x`
    `sqrt(3-5);`
    Results in:

    Answer: -17

  18. Solution: The macro `sqrt(x)` expands to `(3-5)*(3-5)`, evaluating to `-17` due to incorrect usage of parentheses.
  19. Define `true 1`, `false -1`, `null 0`:
    The program:
    `if(null) printf("..."); else if(false) printf("true");`
    Results in:

    Answer: True

  20. Solution: Since `null` is 0 (false), the condition falls to the `else if`, where `false (-1)` is treated as true.
  21. The program fragment:
    `int i = 10; switch (i) { printf("samsung"); case 10: printf("some string"); break; case 5*2: printf("some string"); break; }`
    Results in:

    Answer: Error due to conflicting case

  22. Solution: The case `10` and `5*2` conflict, causing a compilation error.
  23. The program fragment:
    `int i = 5, *j; void *k; k = j = &i; printf("%d", k + 1);`
    Results in:

    Answer: Compilation error

  24. Solution: Arithmetic operations are not allowed on `void` pointers unless explicitly cast, causing a compilation error.




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2025 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy