.
  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 » Sonata Placement Papers » Sonata Previous Year Placement Paper

 

Sonata Placement Paper -: Technical Questions With Answers


Advertisements
Advertisements




Sonata Previous Years Solved Sample Placement Papers

  1. What error would the following function give on compilation?

    f(int a, int b)
    {
        int a;
        a=20;
        return a;
    }

    A. missing parenthesis in the return statement

    B. The function should be declared as int f(int a, int b)

    C. redeclaration of a Answer: Option C

    D. None of the above

  2. Solution: The variable a is redeclared within the same scope, which is not allowed.
  3. Point out the error in the following program:

    main()
    {
        const char *fun();
        *fun()='A';
    }
    const char *fun()
    {
        return "Hello";
    }

    Ans: fun() returns to a const char pointer which cannot be modified

  4. What would be the output of the following program?

    main()
    {
        const int x=5;
        int *ptrx;
        ptrx=&x;
        *ptrx=10;
        printf("%d",x);
    }

    A. 5

    B. 10

    C. Error

    D. Garbage value Answer: Option A

  5. Solution: Attempting to modify a constant variable through a pointer will not change its value in most compilers, but it is undefined behavior. The program prints the original value of x, which is 5.
  6. A switch statement cannot include:

    A. constants as arguments

    B. constant expression as arguments

    C. string as an argument Answer: Option C

    D. None of the above

  7. Solution: A switch statement only accepts constants or constant expressions as arguments; strings are not valid.
  8. How long will the following program run?

    main()
    {
        printf("\nSonata Software");
        main();
    }

    A. infinite loop

    B. until the stack overflows Answer: Option B

    C. All of the above

    D. None of the above

  9. Solution: The function calls itself recursively without any termination condition, leading to stack overflow eventually.
  10. On combining the following statements, you will get char *p; p=malloc(100);

    A. char *p= malloc(100)

    B. p= (char*)malloc(100)

    C. All of the above Answer: Option C

    D. None of the above

  11. Solution: Both forms are valid ways of allocating memory for a char pointer.
  12. What is the output of the following program?

    main()
    {
        int n=5;
        printf("\nn=%*d",n,n);
    }

    A. n=5

    B. n= 5 Answer: Option B

    C. n=5

    D. error

  13. Solution: The %*d format specifier dynamically sets the field width, which in this case is the value of n.




 


.

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