Placement Papers for All Companies

3i infotech
Abacus Infotech
Abatix
Abaxis
ABB
ACC Limited
Accel Frontline
Accenture
Aditi Technologies
Adobe System
ADP
Agilysys
AgreeYa
AIG
AirNet
Alanco Technologies
Alle Technologies
Allfon
Alter Systems
Amazon
AMDL
Amdocs
AMI
Amiti Software Technologies
ANZ
Apple
Applied Materials
Apps Associates
Aricent
ASDC
Ashok Leyland Ltd
Asian Paints
Aspire System
AT & T
Atlas Copco
Atos Origin
AXA Technology Services
Axes Technology
Bain
Bajaj
Bayer
Bharti Airtel Ltd
Bhawan Cybertek
Birlasoft
Blue Star Infotech
BMC
BOB
Brakes India
C-DOT
CA Technologies
Cadence
Calsoft
Canarys
Capgemini
Caterpillar
Celstream
CGI Group
Changepond Technologies
Cimtrix Systems
Cisco system
Citicorp Overseas Software Ltd
ClinTech
CMC Limited
CMS
Cognizant
Compaq
Consagous Technologies
Convergys
CORDYS
CRISIL
Crompton Greaves
CSC
CSFB
CtrlS Datacenters Ltd
Cummins
Cyient
Daffodil
Daimler
Dell
Deloitte
Delphi-TVS
Dharma Systems
Directi
DSRC
Eicher
ELGI
ELICO
EMC Corporation
Emphasis
Ericsson
Ernst & Young
ESKO
Essar
Facebook
Fanuc Corporation
Fidelity
Flextronics
Flipkart
Freescale
Fujitsu
Gajshield
GE
Genpact India
Geodesic
Geometric Limited
GlobalEdge
GlobalLogic
GMR Group
Godrej Infotech
Google
Grapecity
Harita - TVS
HCL
HCL Technologies
Headstrong
Healthasyst
HEC Ltd
Hexaware
HFCL
Holool
Honeywell
HP
HTC Global Services
Huawei
Hughes
Hyundai
IBM
IBS Software Services
IGate
Ikanos
IKOS
Impetus
iNautix
Indecomm
IndiaBulls Power Limited
Inductis-EXL
Industrial Alliance
Infineon
Infogain
Infosys
Intec
Integra
Intel
Intergraph
ITC Infotech
Jindal Steel and Power Limited
KPIT
L & T
L & T Infotech
LG Soft
Linde India Ltd
LnT Emsys
LnT-ECC
Lucas - TVS
Mahindra Engineering Services Ltd
Mahindra Ltd
Maruti
Matrix
Maveric Systems
McAfee
Microland
Microsoft
Mindtree
Miraclesoft
MKCL
Motorola
Mu-Sigma
Nagarro
NASSCOM
NCR Corporation
Ness Technologies
Neudesic
NIIT Technologies
Novell
Nvidia
Oracle
Persistent
Philips
Planetasia
Polaris
Poornam Info Vision
PSI Data Systems Limited
Quest-Global
Quinnox
R Systems
Redpine
Reliance Energy
Robert Bosch
RS Software
Samsung
SAP labs India
Sapient
Sasken Communications
Schneider India
Serco
Siemens
Sierra Atlantic
SkyTECH
Soliton
Sonata Software
Sony India
SQL Star
Steria
Subex Limited
Sutherland Global Services
Syntel
Talisma
Tata motors
Tata technologies
Tata-ELXSI
TCE
TCS
Tech Mahindra
Temenos
Tesco
Texas Instruments
Thermax
ThoughtWorks
Torry Harris
Triad
Trianz
Trilogy
TVS Motor
Unisys
UnitedHealth Group
UST Global
UTC Aerospace System
Valuelabs
Vedanta
Verifone
Verizon
Virtusa
Vision Infotech
Vizual
VMware
Wipro
Yahoo
YASH Technologies
Zenith
Zensar Technologies
ZTE

Sonata Software Technical Paper

Posted on :24-03-2016
Q1. Point out error, if any, in the following program

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

ANS: No error. Constant expression like 1*2+4 are acceptable in cases of a switch. 


Q2. Point out the error, if any, in the following program                                                         
main()
{
    int a=10,b;
    a>= 5 ? b=100 : b=200; 
    printf( %d,b);
}

ANS: l value required in function main(). The second assignment should be written in parenthesis as follows: a>= 5 ? b=100 : (b=200);


Q3. 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 
d) None of the above


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

   main()
   {
   int i=4;
  switch(i)
  {
  default:
  printf( A mouse is an elephant built by the Japanese);                                         
 case 1:
 printf( Breeding rabbits is a hair raising experience);
break;
case 2:
printf( Friction is a drag);
break;
case 3:
printf( If practice make perfect, then nobodys 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


Q5. 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    
b) 11 
c) error 
d) garbage value


Q6. In which line of the following, an error would be reported?                                      
1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf( %f,c);
7. if(CIRCUM(r))==6.28)
8. printf( Gobbledygook);
9. }

a) line 1 
b) line 5 
c) line 6    
d) line 7


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

#define FLOATPTR float*
FLOATPTR a,b;

a) float 
b) float pointer 
c) int 
d) int pointer


Q8. In the following code;

#include<stdio.h>
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.
c) The name of the file. 
d) None of the above.     

                                                
Q9. We should not read after a write to a file without an intervening call to

fflush(), fseek() or rewind() < TRUE/FALSE>

ANS: True


Q10.  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
c) MYP 
d) None of the above


Q11. 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);
  } 

a) 1 2 3     
b) 6 
c) error 
d) 123

Q12. 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);
  }

a) myprog monday tuesday wednesday thursday     
b) monday tuesday wednesday thursday
c) myprog tuesday thursday 
d) None of the above 

                                                  
Q13. In the following code, is p2 an integer or an integer pointer?

 typedef int* ptr
 ptr p1,p2;

ANS: Integer pointer


Q14. 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.


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

main()
  {
   int y=128;
   const int x=y;
   printf(%d,x);
 }

a) 128 
b) Garbage value 
c) Error 
d) 0


Q16.  What is the difference between the following declarations?                                          
   const char *s;
   char const *s;

ANS: No difference


Q17. What would be the output of the following program?
  main()
    {
    char near * near *ptr1;
    char near * far *ptr2;
    char near * huge *ptr3;
    printf(%d %d %d,sizeof(ptr1),sizeof(ptr2),sizeof(ptr3));
   }

a) 1 1 1         
b) 1 2 4       
c) 2 4 4    
d) 4 4 4


Q18. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?

main(int argc, char*argv[])
  {
   printf(%c,**++argv);
  }

a) m     
b) f 
c) myprog 
d) friday


Q19. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?                                                                                      
 main(int argc, char *argv[])
   {
    printf(%c,*++argv[1]);
     }

a) r 
b) f 
c) m 
d) y


Q20.  If the following program (myprog) is run from the command line as myprog friday tuesday sunday. What would be the output?

main(int argc, char *argv[])
   {
  while(sizeofargv)
  printf(%s,argv[--sizeofargv]);
  }
a) myprog friday tuesday sunday 
b) myprog friday tuesday
c) sunday tuesday friday myprog 
d) sunday tuesday friday        

                       
Q21.  Point out the error in the following program

main()
  {
   int a=10;
   void f();
   a=f();
   printf( %d,a);
   }
   void f()
    {
    printf( Hi);
    }

ANS: The program is trying to collect the value of a void function into an integer variable.


Q22.  In the following program how would you print 50 using p?

main()
   {
    int a[]={10, 20, 30, 40, 50};
    char *p;
    p= (char*) a;
   }

ANS: printf( %d,*((int*)p+4));


Q23.  Would the following program compile?

main()
  {
   int a=10,*j;
   void *k;
   j=k=&a;
   j++;
   k++;
   printf( %u%u,j,k);
}

a) Yes 
b) No, the format is incorrect
c) No, the arithmetic operation is not permitted on void pointers             
d) No, the arithmetic operation is not permitted on pointers


Q24. According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments?

a) main(int argc, char *argv[]) 
b) main(argc,argv) int argc; char *argv[];
c) main() {int argc; char *argv[]; } 
d) None of the above


Q25. 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    
d) None of the above

                                            
Q26. 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


Q27. 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


Q28. A switch statement cannot include

a) constants as arguments 
b) constant expression as arguments                                
c) string as an argument 
d) None of the above


Q29. How long the following program will run?

main()
{
printf( Sonata Software);
main();
}

a) infinite loop     
b) until the stack overflows
c) All of the above 
d) None of the above


Q30. 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 
d) None of the above


Q31. What is the output of the following program?

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

a) n=5   
b) n=5   
c) n= 5 
d) error



  
   






FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.

closepop
closepop