.
  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. Point out error, if any, in the following program:

    
    main() {
      int i = 1;
      switch (i) {
        case 1:
          printf("\nRadioactive cats have 18 half-lives");
          break;
        case 1 * 2 + 4:
          printf("\nBottle for rent - inquire within");
          break;
      }
    }
        

    Ans. No error. Constant expressions like 1*2+4 are acceptable in cases of a switch.

  2. Point out the error, if any, in the following program:

    
    main() {
      int a = 10, b;
      a >= 5 ? b = 100 : b = 200;
      printf("\n%d", b);
    }
        

    Ans. lvalue required in function main(). The second assignment should be written in parentheses as follows:

    a >= 5 ? b = 100 : (b = 200);

  3. In the following code, in which order the functions would be called?

    a = f1(23, 14) * f2(12 / 4) + f3();

    A. f1, f2, f3

    B. f3, f2, f1

    C. The order may vary from compiler to compiler Answer: Option C

    D. None of the above

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

    
    main() {
      int i = 4;
      switch (i) {
        default:
          printf("\n A mouse is an elephant built by the Japanese");
        case 1:
          printf(" Breeding rabbits is a hare raising experience");
          break;
        case 2:
          printf("\n Friction is a drag");
          break;
        case 3:
          printf("\n If practice makes perfect, then nobody's perfect");
      }
    }
        

    A. A mouse is an elephant built by the Japanese

    B. Breeding rabbits is a hare raising experience

    C. All of the above

    D. None of the above Answer: Option D

  5. What is the output of the following program?

    
    #define SQR(x) (x * x)
    main() {
      int a, b = 3;
      a = SQR(b + 2);
      printf("%d", a);
    }
        

    A. 25 Answer: Option A

    B. 11

    C. error

    D. garbage value

  6. In which line of the following, an error would be reported?

    
    #define CIRCUM(R) (3.14 * R * R)
    main() {
      float r = 1.0, c;
      c = CIRCUM(r);
      printf("\n%f", c);
      if (CIRCUM(r) == 6.28)
        printf("\nGobbledygook");
    }
        

    A. line 1

    B. line 5

    C. line 6

    D. line 7 Answer: Option D

  7. What is the type of the variable b in the following declaration?

    
    #define FLOATPTR float *
    FLOATPTR a, b;
        

    A. float

    B. float pointer Answer: Option B

    C. int

    D. int pointer

  8. In the following code:

    
    #include 
    main() {
      FILE *fp;
      fp = fopen("trial", "r");
    }
        

    fp points to:

    A. The first character in the file.

    B. A structure which contains a "char" pointer which points to the first character in the file. Answer: Option B

    C. The name of the file.

    D. None of the above.

  9. We should not read after a write to a file without an intervening call to fflush(), fseek(), or rewind(). TRUE/FALSE

    Ans. True

  10. If the program (myprog) is run from the command line as myprog 1 2 3, What would be the output?

    
    main(int argc, char *argv[]) {
      int i;
      for (i = 0; i < argc; i++)
        printf("%s", argv[i]);
    }
        

    A. 1 2 3

    B. C:\\MYPROG.EXE 1 2 3 Answer: Option B

    C. MYP

    D. None of the above




 


.

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-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy