Philips Interview Questions
- 0of 0 votes
AnswersCount maximum number of pair (a, b) possible from an array so that a is less than equal to 2*b. Also tell number of unpaired element left.
- ganesh.eng2015 August 19, 2018 in India
So for Input
1, 3, 5, 6, 7
ans = 2 1| Report Duplicate | Flag | PURGE
Philips Backend Developer - 0of 0 votes
AnswersAn array is special if it contains special elements. A special element is an element which can be represented by the sum of two numbers where one number is reverse of other. Like Array is {22, 121} . Here 22 = 11 + 11 and 121 = 92 + 29. Hence both elements are special. The input array is an array of strings. Output number of special elements in the array.
- ganesh.eng2015 August 19, 2018 in India| Report Duplicate | Flag | PURGE
Philips Backend Developer - 0of 0 votes
AnswerCopy the following program into ptr3.c.
- stimulation101 March 04, 2017 in England
#include <stdio.h>
int main()
{
int i, j;
int * p, * q;
int ** x;
i = 100;
j = 200;
p = &i;
q = &j;
x = &p;
*p = *p + *q;
*q = **x / 2;
**x = *p + j;
printf(" i = %d\n", i);
printf("&i = %p\n", &i);
printf(" j = %d\n", j);
printf("&j = %p\n", &j);
printf(" p = %p\n", p);
printf("&p = %p\n", &p);
printf("*p = %d\n", *p);
printf(" q = %p\n", q);
printf("&q = %p\n", &q);
printf("*q = %d\n", *q);
printf(" x = %p\n", x);
printf("&x = %p\n", &x);
printf("*x = %p\n", *x);
printf("**x= %d\n", **x);
return 0;
}
Study this code carefully and make sure you understand how the program works. Then modify the program by adding a new variable that stores the address of x. Then use your variable to update (indirectly) the value of i and then print out the new value to demonstrate that your modification has worked.| Report Duplicate | Flag | PURGE
Philips Junior programmer - 0of 0 votes
AnswersCreate a text file called calc.c that contains the following C program:
- stimulation101 March 04, 2017 in England
#include <stdio.h>
float add (float x, float y)
{
return x + y;
}
int main()
{
float a, b, r;
char op;
do {
printf("number op number? ");
scanf(" %f %c %f", &a, &op, &b);
switch (op)
{
case '+' : r = add(a,b);
break;
case 'q' : break;
default : op='?';
}
if (op=='?')
printf("Unknown operator\n");
else if (op=='q')
printf("Bye\n");
else
printf("%f %c %f = %f\n", a, op, b, r);
}
while (op != 'q');
return 0;
}
The program behaves like a calculator asking the user to type in binary expressions (like 2.5 + 3.7) and printing out the results. If the user enters 'q' for the operator (e.g. 0 q 0) then this is taken as a signal to stop the program.
Add a new function to the program that multiplies its two arguments together and returns their product. Then modify the switch statement so that the operator '*' causes this new product function to be called. Test the program by using a mixture of '+' and '*' calculations.
Add operators for subtraction ('-') and division ('/') and test your program again.
We introduce some special operators. Write functions to implement each of these (adding one at a time and testing after each new operator is incorporated into your calculator).
Symbol Description Example
m Minimum 2.3 m 1.7 = 1.7
M Maximum 2.3 M 1.7 = 2.3| Report Duplicate | Flag | PURGE
Philips Junior programmer Programmin in c - 0of 0 votes
AnswersWht is 'volatile' in c?
- sasi123789 November 01, 2011 in India| Report Duplicate | Flag | PURGE
Philips - 0of 0 votes
AnswersDesign an BPO company.
- VN May 01, 2007
1. Company has 3 levels of employee, Fresher,TL,PM.
2. Any incoming call(telephone) has to be allocated to the Fresher who is fre.
3. Call has to be closed in 8hrs.
4. If fresher not able to handle the call, escalate the call to TL.
5. If TL not free or not able to handle escalate to PM.
6. When call is comming it shoulbe be assigned to the Fresher who is free at that time.
for above feattures put an class diagram in place.| Report Duplicate | Flag | PURGE
Philips Software Engineer / Developer Object Oriented Design