.
  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 the 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 parenthesis as follows: a>=5 ? b=100 : (b=200);
  3. In the following code, in which order would the functions be called?
    a = f1(23,14)*f2(12/4)+f3();
                
    1. f1, f2, f3
    2. f3, f2, f1
    3. The order may vary from compiler to compiler
    4. 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 hair raising experience);
          break;
        case 2:
          printf(\n Friction is a drag);
          break;
        case 3:
          printf(\n If practice makes perfect, then nobody’s perfect);
      }
    }
                
    1. A mouse is an elephant built by the Japanese
    2. Breeding rabbits is a hare raising experience
    3. All of the above
    4. None of the above
  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);
    }
                
    1. 25
    2. 11
    3. Error
    4. 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);
    }
                
    1. Line 1
    2. Line 5
    3. Line 6
    4. Line 7
  7. What is the type of the variable b in the following declaration?
    #define FLOATPTR float*
    FLOATPTR a,b;
                
    1. float
    2. float pointer
    3. int
    4. int pointer
  8. In the following code:
    #include<stdio.h>
    main()
    {
      FILE *fp;
      fp = fopen(trial,r);
    }
                
    1. The first character in the file
    2. A structure which contains a char pointer which points to the first character in the file
    3. The name of the file
    4. None of the above
  9. We should not read after a write to a file without an intervening call to fflush(), fseek(), or rewind(). 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]);
    }
                
    1. 1 2 3
    2. C:\MYPROG.EXE 1 2 3
    3. MYP
    4. None of the above
  11. If the following 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,j=0;
      for(i=0;i<argc;i++)
        j = j + atoi(argv[i]);
      printf(%d,j);
    }
                
    1. 1 2 3
    2. 6
    3. Error
    4. 123
  12. If the following program myprog is run from the command line as myprog monday tuesday wednesday thursday, what would be the output?
    main(int argc, char *argv[])
    {
      while(--argc > 0)
        printf(%s,*++argv);
    }
                
    1. myprog monday tuesday wednesday thursday
    2. monday tuesday wednesday thursday
    3. myprog tuesday thursday
    4. None of the above
  13. In the following code, is p2 an integer or an integer pointer?
    typedef int* ptr
    ptr p1,p2;
                
    Ans: Integer pointer
  14. Point out the error in the following program:
    main()
    {
      const int x;
      x = 128;
      printf(%d,x);
    }
                
    Ans: x should have been initialized where it is declared.
  15. What would be the output of the following program?
    main()
    {
      int y=128;
      const int x=y;
      printf(%d,x);
    }
                
    1. 128
    2. Garbage value
    3. Error
    4. 0




 


.

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