# Motorola Technical Test April 2011

Posted on :10-03-2016

Q1. For n=2 the following fn returning value is

int fun(int n)
{
for(i = 1;i<=n;i++)
for(j=i;j<=i;j++)
sum=sum+j;
return(sum);
}

ANS: 6

Q2. How can you insert the following values in stack and numbers

0,20,30,40,50.60
stack [][][][][][]
numb [][][][][][][]

ANS:
60 50 40 30 20 10
10 20 30 40 50 60

Q3. What is the output?

int term (int x)
{ int sum=0;int i;
for(i=0;i<=5;i++)
sum+=x; /*problel is wrong but Ans is 650.*/
return(sum);

ANS: 650

Q4. What is the output?

a=5 b=10 c=7
(a>c)?a:((b>c)?b:c)

ANS: 10

Q5.  What is the output of the following program?

main()
{
int arr[100];
int c:
int N;
for(i=-:i
arr[i]=i;
minvalue i = .....
Maxvalue i = .....

ANS: 0,100 respectively.

Q6. What is the output?

For x=2, y=3, z=1
the following fn return
int fun(int n; int y; int z)
{
int sum
for(i=x;i<=y;i++)
for(j=1;j<=z;z++)
sum=sum+z;
return sum
}

ANS: 0

Q7. The values of sum from above function for x=0; y=0; z=1

ANS: 1

Q8. what is meaning?

# if ndif XYZ
#include XYZ.h
#endif

ANS: If XYZ is not defined then only include the header file XYZ.h.

Q9. Debugging eliminates what?

ANS: Both logical & run time errors.

Q10. p:malloc(int*sizeof(int));  => This statement will return what?

ANS: a

FreshersLive - No.1 Job site in India. Here you can find latest 2020 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.

 ✖