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

SAP labs Technical Paper

Posted on :12-02-2016
SAP labs Technical Paper:-

Q1. What will be output of following c program?

struct myStruct
{
int a;
char b;
}
*ptr;
int main()
{
struct myStruct ms={400,A};
printf(%d %d,ptr->a,ptr->b);
return 0;
}
    
a) 400 A            
b) 400 65            
c) 400 97            
d) 0 0

ANS: d


Q2. Which is a boolean operator for logical-and?

a) &
b) &&
c) |
d) |&


Q3. What is the purpose of NOT NULL constraint?

a) allows NULL values in table
b) allow to pass NULL values in column
c) does not allow NULL values in table
d) does not allow NULL values in column


Q4. Point out the error if any in the while loop.

main()
{
 int i =0;
 while()
 {
 printf(%d,i++);
 if(i>10)
break;
 }
}
    
a) the condition in the while loop is a must        
b) the while lop must be replaced by a for loop

ANS: a


Q5. What is the output of the following program?

void main()
{
int a, *pa, &ra;
pa = &a;
ra = a;
cout «a=«a «*pa=«*pa «ra«ra ;
}

a) ra
b) ra ra ra
c) Compiler error
d) None of these


Q6. Out of the following which is a correct comment?

a) */ Comments */
b) ** Comment **
c) /* Comment */
d) { Comment }


Q7. What will be the output of the program if the array begins at 65486 and each integer occupies 2 bytes?

int main()
{
 int arr[] = {12, 14, 15, 23, 45};
 printf(%u, %u , arr+1, &arr+1);
 return 0;
 }
    
a) 12, 65490        
b) 14, 65492        
c) 65488, 65496        
d) 64490, 65498

ANS: c


Q8. What is the command to delete an index?

a) DROP index empno.empid
b) DELETE index empno.empid
c) REMOVE index empno.empid
d) None of the above


Q9. What is the terminator that is used to terminate C++ code?

a) . (dot)
b) ; (semi-colon)
c) : (colon)
d)  (single quote)


Q10. What will be the output of the program?

 #include
 int main()
 {
int i=3, j=4, k, l;
k = addmult(i, j);
l = addmult(i, j);
printf(%d %d , k, l);
return 0;
}
int addmult(int ii, int jj);
{
int kk, ll;
kk = ii + jj;
ll = ii * jj;
return (kk, ll);
}
    
a) Function addmult()return 7 and 12        
b) No output        
c) Error: Compile error        
d) None of above

ANS: c


Q11. If int is 2 bytes wide, what will be the output of the program?

 #include
 void fun(char**);
 int main()
 {
 char *argv[] = {ab, cd, ef, gh};
 fun(argv);
 return 0;
 }
void fun(char **p)
{
 char *t;
 t = (p+= sizeof(int))[-1];
 printf(%s , t);
 }
    
a) ab            
b) cd            
c) ef            
d) gh

ANS: b


Q12. What will be output when you will execute following c code?

void main()
{
volatile int a=11;
printf(%d,a);
}
    
a) Garbage        
b) 11            
c) 2            
d) We cannot predict

ANS: d


Q13. What will be output of following c program?

#include string.h
typedef struct stu1
{
int roll;
char *name;
double marks;
}
STU1;
typedef struct stu2
{
int roll;
char *name;
double marks;
}
STU2;
void main()
{
        STU1 s1={25,Rohit,87.43},*p1;
        STU2 *p2; p1=&s1;
        memcpy(p2,p1,4);
        printf(Roll : %d ,p2->roll);
        printf(Name : %s ,p2->name);
        printf(Marks : %lf,p2->marks);
    }
    
a) Roll : 25 Name : Rohit Marks : 87.430000        
b) Roll : 25 Name : Rohit Marks : 0.000000        
c) Roll : 0 Name : Rohit Marks : 87.430000        
d) Roll : 0 Name : null Marks : 0.000000

ANS: b


Q14. Recursive functions are executed in a
    
a) last in first out order        
b) first in First out order        
c) Are maintained in a stack        
d) None of the above

ANS: a


Q15. What will be output of following c program?

int main()
{
for(printf(1);!printf(0);printf(2)) printf(Sachin);
return 0;
}
    
a) 10sachin2        
b) 10sachin        
c) 10sachin210sachin2            
d) 10

ANS: d


Q16. Assume integer is 2 bytes wide. How many bytes will be allocated for the following code?

#include
#include
#define MAXROW 3
#define MAXCOL 4
int main()
{
int (*p)[MAXCOL];
p = (int (*) [MAXCOL])malloc(MAXROW *sizeof(*p));
return 0;
}   
 
a) 56 bytes        
b) 128 bytes        
c) 24 bytes        
d) 12 bytes

ANS: c


Q17. What will be the output of the program?

#include
void fun(int);
int main()
{
int a=3;
fun(a);
return 0;
}
void fun(int n)
{
if(n > 0)
{
fun(--n);
printf(%d,, n);
fun(--n);
}
}
    
a) 0, 2, 1, 0            
b) 1, 1, 2, 0           
c) 0, 1, 0, 2            
d) 0, 1, 2, 0

ANS: d


Q18. What will be the content of file.c after executing the following program?

#include
int main()
{
FILE *fp1, *fp2;
fp1=fopen(file.c, w);
fp2=fopen(file.c, w);
fputc(A, fp1);
fputc(B, fp2);
fclose(fp1);
fclose(fp2);
return 0;
}
    
a) B            
b) A B            
c) B B            
d) Error in opening file file1.c

ANS: a


Q19. What will be the output of the program?

#include
int main()
{
unsigned int i = 65535;
/* Assume 2 byte integer*/
while(i++ != 0)
printf(%d,++i);
printf( );
return 0;
}
    
a) Infinite loop        
b) 0 1 2 ... 65535        
c) 0 1 2 ... 32767 - 32766 -32765 -1 0       
d) No output

ANS: a


Q20. Which type is not used in C++?

a) float
b) real
c) int
d) double


Q21. What will be the output of the program?

#include
int main()
{
int fun();
int i;
i = fun();
printf(%d , i);
return 0;
}
int fun()
{
 _AX = 1990;
}
    
a) Garbage value            
b) 0 (Zero)        
c) 1990            
d) No output

ANS: c


Q22. Which operator is used to compare two variables?

a) : =
b) =
c) equal
d) ==


Q23. Point out the error in the following program.

 #include
 int main()
 {
 char str[] = Freshersworld;
 printf(%.#s %2s, str, str);
 return 0;
 }
    
a) in Array declaration        
b) printf statement        
c) unspecified character in printf        
d) No error

ANS: d


Q24. What will be output of following c program?

 void main()
 {
 int a[]={5,10,15};
 int i=0,num;
 num=a[++i]+ ++i+(++i);
 printf(%d,num);
 }
    
a) 6            
b) 17            
c) 16            
d) 12

ANS: a


Q25. 
main()
{
int i;
print(%d,scanf(%d,&i));
// value 10 is given to the input here
}

What is the ouput of above snippet?
    
a) 1        
b) compiler error            
c) syntax error            
d) 2

ANS: a


Q26. Find the output from following program?

#include
int main()
{
int a = 10, b;
a >=5 ? b=100: b=200;
printf(%d , b);
return 0;
}
    
a) 100            
b) 200            
c) Error: L value required for b        
d) Garbage value

ANS: c


Q27. What will be the output of the program?

#include
#define SQR(x)(x*x)
int main()
{
int a, b=3;
a = SQR(b+2);
printf(%d , a);
return 0;
}
    
a) 25            
b) 11            
c) Error            
d) Garbage value

ANS: b


Q28. What will be the output of the program?

#include
int main()
{
int i = 5;
while(i-- >= 0)
printf(%d,, i);
i = 5;
printf( );
while(i-- >= 0)
printf(%i,, i);
while(i-- >= 0)
printf(%d,, i);
return 0;
}

a) 4, 3, 2, 1, 0, -1
4, 3, 2, 1, 0, -1

b) 5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0

c) Error

d) 5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
5, 4, 3, 2, 1, 0
    
a) A            
b) B            
c) C            
d) D

ANS: a


Q29. 
void main()
{
char far *farther, *farthest;
printf(%d..%d,sizeof(farther),sizeof(farthest));
}

What is the output of above snippet?
    
a) 2.4            
b) syntax error        
c) compiler error        
d) 4.2

ANS: d


Q30. What will be the output of the program?

#include
int main()
{
float arr[] = {12.4, 2.3, 4.5, 6.7};
printf(%d , sizeof(arr)/sizeof(arr[0]));
return 0;
}
    
a) 4            
b) 5            
c) 6            
d) 7

ANS: a


Q31. What will be the output of the program?

#include
int main()
{
int i;
i = printf(How r u );
i = printf(%d, i);
printf(%d, i);
return 0;
}
    
a) How r u 7 2        
b) How r u 8 2        
c) How r u 1 1        
d) Error: cannot assign printf to variable

ANS: b


Q32. Evaluate !(1 && !(0 || 1)).

a) True
b) False
c) Error
d) None of these


Q33. Find the output of following snippet?

# include 
void main()
{
char letter = Z;
printf(%c,letter);
}
    
a) Z        
b) 90            
c) Garbage Value            
d) error

ANS: a


Q34. What will be output of following c program? 

int main()
{
float **(*ptr)[4]=(float **(*)[4]);
ptr+=5;
printf(%d %d,ptr,sizeof ptr); return 0;
}
    
a) 0 2            
b) 5 2            
c) 4 2            
d) 40 2

ANS: d


Q35. What will be the output of the program if value 25 given to scanf()?

#include
int main()
{
int i;
printf(%d , scanf(%d, &i));
return 0;
}
    
a) 1            
b) 2            
c) 5            
d) 25

ANS: a


Q36. What will be output of following c program?

 void main()
 {
 int z;
 z=(5,3,2);
 printf(%d,z);
 }
    
a) 5            
b) 3            
c) 2            
d) 10

ANS: c


Q37. What will be output of following c program? 

void main()
{
int a,i=4;
a=- -i+- -i+- -5;
printf(%d %d,a,i);
}
    
a) 13 4            
b) -3 2            
c) 7 2            
d) -13 4    

ANS: a


Q38. 
main()
{
char *p;
p =Hello;
printf (%c *&*p);
}

What is the output of above snippet ?

a) H            
b) syntax error        
c) compiler error            
d) E

ANS: a


Q39. What is the output of following snippet?

main()
{
int c[] = { 2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf(%d,*c);
++q;
}
for (j =0; j<5;j++)
{
printf(%d,*p);
++p;
}
}
    
a) syntax error        
b) compiler error            
c) 2 2 2 2 2 2 3 4 6 5        
d) 5 6 4 5 2 2 2 2

ANS: c


Q40. What is the command to create an index?

a) CREATE index name on table (empno)
b) CREATE name index on table 
c) CREATE table
d) None of the above


  
   






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