Receive All Updates Via Facebook. Just Click the Like Button Below...


Click to Skip
Powered By Jobs

Get Free Job Updates On Your Email

Check your Email To Activate The Link

Advertisements

Friday, 13 January 2017

SAP Placement Paper part 1

Advertisements

SAP Placement Paper part 1




1. 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\n", t);
}

A.ab B.cd C.ef D.gh

Answer: B

2. 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\n", arr+1, &arr+1);
return 0;
}

A.12, 65490 B.14, 65492 C.65488, 65496 D.64490, 65498

Answer: C

Explanation:
Here, the base address(also the address of first element) of the array is 65486. => Here, arr is reference to arr has type "pointer to int". Therefore, arr+1 is pointing to second element of the array arr memory location. Hence 65486 + 2 bytes = 65488 => Then, &arr is "pointer to array of 5 ints". Therefore, &arr+1 denotes "5 ints * 2 bytes * 1 = 10 bytes". Hence, begining address 65486 + 10 = 65496. So, &arr+1 = 65496. Hence the output of the program is 65488, 65496.

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

Answer: A

4. 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\n", 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

Answer: C

Explanation:
There is an error in this statement int addmult(int ii, int jj);. We have to remove the semi-colon, because it was an definition of the function addmult()

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

Answer: A

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

Answer: D

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

Answer: D

8. What will be the output of the program?
#include
int main()
{
int fun();
int i;
i = fun();
printf("%d\n", i);
return 0;
}
int fun()
{
_AX = 1990;
}

A.Garbage value B.0 (Zero) C.1990 D.No output

Answer: C

Explanation:
The return value of the function is taken from the Accumulator _AX=1990.

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

Answer:A

10. What will be the output of the program?
#include
int main()
{
int i = 5;
while(i-- >= 0)
printf("%d,", i);
i = 5;
printf("\n");
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

Answer: A


To Continue on 2nd part --->>Click here<<---

Advertisements

Share:

0 comments:

Post a Comment

Latest Walk-in jobs

Fresher Jobs Openings 2017

IT Jobs Openings 2017

Like Us On Facebook

Government Jobs

Jobs By City

Jobs By Education

Top Multinational Companies

ABB Job Openings

Adecco Job Openings

Aegis Job Openings

Akamai Job Openings

Allianz Job Openings

Allsec Technologies Job Openings

Amazon Job Openings

Amdocs Job Openings

Ample Job Openings

Annik Job Openings

Atos Job Openings

Autodesk Job Openings

Barclays Job Openings

BNY Mellon Job Openings

Boeing Job Openings

Bridgestone Job Openings

Broadridge Job Openings

Calypso Job Openings

Capgemini Job Openings

Cipla Job Openings

Cisco Job Openings

CMS IT Job Openings

Cognizant Job Openings

Collabera Job openings

CONCENTRIX Job Openings

CSC Job Openings

Cyient Job Openings

Datamatics Job Openings

Dell Job Openings

Deloitte Job Openings

Directi Job Openings

Ebizon Job Openings

EFI Job Openings

EMC Job Openings

EXL Services.com Job Openings

Expedia Job Openings

EY Job Openings

Fidelity Job Openings

First American Job Openings

Fiserv Job Openings

Flextronics Job Openings

Foodpanda Job Openings

FSS Job Openings

General Motors Job Openings

Genpact Job Openings

Geometric Job Openings

GlobalLogic Job Openings

HCL Job Openings

Hexaware Job Openings

Hinduja Global Solutions Job Openings

Hitachi Job Openings

Honeywell Job Openings

HP Job Openings

IBM Job Openings

Informatica Job Openings

Infosys Job Openings

Ingram Micro Job Openings

InTarvo Job Openings

Intel Job Openings

Intuit Job Openings

Ionidea Job Openings

JPMorgan Chase Job openings

KPMG Job Openings

Larsen and Toubro Job Openings

Lenskart Job Openings

Logitech Job Openings

Magna Infotech Job Openings

Makemytrip Job Openings

Maple Software Job openings

Maxim Integrated Job Openings

Microland Job Openings

Mindtree Job Openings

Mu Sigma Job Openings

Nokia Job Openings

Oracle Job Openings

Paypal Job Openings

Paytm Job Openings

Qualcomm Job Openings

Randstad Job Openings

Redbus Job Openings

Reliance Job openings

Robert Bosch Job Openings

Rolta Job Openings

Salesforce Job Openings

Sap Job openings

Sapient Job Openings

Sasken Job Openings

Shell Job Openings

Siemens Job Openings

Sopra Job Openings

Tata Motor Job Openings

TCS Job Openings

Tech Mahindra Job Opening

Tesco Job Openings

Tom Tom Job Openings

United Health Group Job Openings

UPS Logistics Job Openings

ValueLabs Job Openings

Verizon Job Openings

Virtusa Job Openings

Wipro Job Openings

Xerox Job Openings

XL Dynamics Job Openings

Yahoo Job Openings

Zebronics Job Openings

Zensar Job Openings