Sonata Technical questions
Sonata Technical questions
Some of the technical questions observed in the technical section of the written test paper are:
1. In which order the functions shall be called in the below mentioned code.
a = fl(23,14)*f2(12/4)+f3();
a. The order may vary from compiler to compiler
b. F1, f2, f3
c. F3, f2, f1
d. None of the above
2. Find the output of the below mentioned program
Main ()
{
int i= 4;
switch (i)
{
Default:
printf(\n A mouse is an elephant built by the Japanese);
Case 1:
printf(Breeding rabbits is a hair raising experience);
Case 2:
printf(\n Friction is a drag);
break;
Case 3:
printf(\n If practice make perfect, then nobody’s perfect)
}
}
a. Breeding rabbits is a hare raising experience
b. A mouse is an elephant built by the Japanese
c. All of the above
d. None of the above
3. Locate the error in the below mentioned lines.
1. #define CIRCUM(R) (3.14*R*R);
2. Main()
3. {
4. Float r=1.0,c;
5. C=CIRCUM(r);
6. printf(\nGobbledygook);
7. printf(\n%f,c);
8. If(CIRCUM(r))==6.28
9. }
a. Line 7
b. Line 1
c. Line 6
d. Line 5
4. Choose the type of the variable in the following declaration?
#define FLOATPTR float*
FLOATPTR a, b;
a. Integer
b. Integer pointer
c. Float pointer
d. Float
5. typedef int*ptr
ptr p1, p2;
In the above mentioned code, P2 should be an integer or an integer pointer?
6. Point out the error in the below mentioned program?
main()
{
Constant integer x;
X=128;
Printf(%d,x);
}
7. State the difference between the following declarations.
const char*s;
char const*s;
8. What shall be the following program compile?
main()
{
Int a= 10, *j;
void*k;
J=k=&a;
J++;
K++;
printf(\n%u%u,j,k);
a. No, the format is incorrect
b. Yes
c. No, the arithmetic operation is not permitted on pointers
d. No, the arithmetic operation is not permitted on void pointers
9. How long the below mentioned program will run?
Main()
{
Printf(\nSonata Software);
Main():
}
a. Until the stack overflows
b. Infinite loop
c. All of the above
d. None of the above
10. On combining char*p;p=malloc(100); what shall you get?
a. P=(char*)malloc(100)
b. Char*p=malloc(100)
c. All of the above
d. None of the above