2011 Data Patterns Placement Paper - IIChennai

  • CategoryIT
  • Sub CategoryPlacement Papers
  • LocationChennai
  • CompanyData Patterns
  • Posted date on our Website21 April 2011

User Ratings

0
Here are the details of 2011 Data Patterns Placement Paper - II job in Data Patterns. This job or placement paper has been sourced from either company website or newspaper or other media and from students who appeared for this job. User is requested to verify the data before applying for the job.

2011 Data Patterns Placement Paper - II with Answers, Solutions:-

1. What would be the output of the following 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");
break;
case 2:
printf("\n Friction is a drag");
break;
case 3:
printf("\n If practice make perfect, then nobody's perfect");
}
}
a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience
c) All of the above d) None of the above

2. What is the output of the following program?

#define SQR(x) (x*x)
main()
{
int a,b=3;
a= SQR(b+2);
printf("%d",a);
}
a) 25 b) 11 c) error d) garbage value

3. In which line of the following, an error would be reported?
1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf("\n%f",c);
7. if(CIRCUM(r))==6.28)
8. printf("\nGobbledygook");
9. }
a) line 1 b) line 5 c) line 6 d) line 7

4. What is the type of the variable b in the following declaration?

#define FLOATPTR float*
FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer

5. In the following code;
#include<stdio.h>
main()
{
FILE *fp;
fp= fopen("trial","r");
}
fp points to:
a) The first character in the file.
b) A structure which contains a "char" pointer which points to the first character in the file.
c) The name of the file. d) None of the above.

9. We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind() < TRUE/FALSE>
Ans. True

6.  If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output?

main(int argc, char *argv[])
{
int i;
for(i=0;i<argc;i++)
printf("%s",argv[i]);
}
a) 1 2 3 b) C:\MYPROG.EXE 1 2 3
c) MYP d) None of the above

7. If the following program (myprog) is run from the command line as myprog 1 2 3, What would be the output?

main(int argc, char *argv[])
{
int i,j=0;
for(i=0;i<argc;i++)
j=j+ atoi(argv[i]);
printf("%d",j);
}
a) 1 2 3 b) 6 c) error d) "123"

8. If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday? What would be the output?

main(int argc, char *argv[])
{
while(--argc >0)
printf("%s",*++argv);
}
a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday
c) myprog tuesday thursday d) None of the above

9. In the following code, is p2 an integer or an integer pointer?

typedef int* ptr
ptr p1,p2;
Ans. Integer pointer

10.
If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?

main(int argc, char *argv[])
{
while(sizeofargv)
printf("%s",argv[--sizeofargv]);
}
a) myprog friday tuesday sunday b) myprog friday tuesday
c) sunday tuesday friday myprog d) sunday tuesday friday

11.Point out the error in the following program

main()
{
int a=10;
void f();
a=f();
printf("\n%d",a);
}
void f()
{
printf("\nHi");
}
Ans. The program is trying to collect the value of a "void" function into an integer variable.

12. In the following program how would you print 50 using p?

main()
{
int a[]={10, 20, 30, 40, 50};
char *p;
p= (char*) a;
}
Ans. printf("\n%d",*((int*)p+4));

13. Would the following program compile?

main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("\n%u%u",j,k);
}
a) Yes b) No, the format is incorrect
c) No, the arithmetic operation is not permitted on void pointers
d) No, the arithmetic operation is not permitted on pointers

14. According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments?

a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[];
c) main() {int argc; char *argv[]; } d) None of the above

15. What error would the following function give on compilation?

f(int a, int b)
{
int a;
a=20;
return a;
}
a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b)
c) redeclaration of a d) None of the above

16. Point out the error in the following program

main()
{
const char *fun();
*fun()='A';
}
const char *fun()
{
return "Hello";
}
Ans. fun() returns to a "const char" pointer which cannot be modified

17. What would be the output of the following program?

main()
{
const int x=5;
int *ptrx;
ptrx=&x;
*ptrx=10;
printf("%d",x);
}
a) 5 b) 10 c) Error d) Garbage value

18. A switch statement cannot include

a) constants as arguments b) constant expression as arguments
c) string as an argument d) None of the above

19. How long the following program will run?

main()
{
printf("\nSonata Software");
main();
}
a) infinite loop b) until the stack overflows
c) All of the above d) None of the above

20. On combining the following statements, you will get char*p; p=malloc(100);

a) char *p= malloc(100) b) p= (char*)malloc(100)
c) All of the above d) None of the above

About Data Patterns:-   

Data Patterns focuses on building reliable open architecture building blocks on various internationally accepted standards such as cPCI, VME, PCI and other Mezzanine standards such as IP, M Module, and PMC. These building blocks are further utilized in order to provide functional solutions in the areas of automatic testing and data acquisition solutions.

Data Patterns software development group provides the drivers for all the products listed in this brochure. In addition, end applications required by customers are implemented. The standard products are provided with drivers in environment such as Windows 2000 and Real-time Linux. Optionally drivers are provided in other operating environments such as Vxworks, Lynx OS, and so on. Where applicable, support is provided for other platforms such as Labview, HPVee, QNX, Real-time Windows XP.

Data Patterns undertakes design, development and manufacture of complex systems adhering to difficult functional, environmental and design constraints. These include airborne systems, mobile vehicle based applications, Space vehicle and Satellite borne systems, Ship borne systems. These systems are designed with detailed analysis of the design goals, validation of signal integrity, thermal simulation, Analysis of performance under Vibration and Shock conditions and so on.

Working at Data Patterns - why should i join Data Patterns ?:-

Data Patterns provides a nurturing environment for serious workers. Its commitment to expansion is demonstrated by its 80 percent, average year-on-year growth for the past 5 years. If you want to seize the synergy between carrying a process to its result and learning from the process itself, come join us. Data Patterners work as a task force, willing to pitch in where required, while still having defined responsibilities for their role. Employee empowerment and guidance from senior management reward dedicated team players.

Data Patterns is an Equal Opportunity Employer and hires both fresh engineers and engineers with experience for its core functions. It also hires in other functions from time to time. Its recruitment drive involves scanning an in-house database as well.
 

Contact Details:

Address of Data Patterns:-

Data Patterns (India) Pvt. Ltd.
No 19, Arya Gowder Road
West Mambalam
CHENNAI 600 033
Tamilnadu
India
Phone    : +91 44 2483 7460
Fax    : +91 44 2484 8703


Bangalore

Data Patterns (India) Pvt. Ltd.
105,10th Cross
HAL l Stage, Indra Nagar
BANGALORE - 560 038
Karnataka
India
Phone: +91 80 4242 4141
Fax: +91 80 4242 4142


Hyderabad

Data Patterns (India) Pvt. Ltd.
Plot No. 6&11, 3rd Floor
Veeranag Towers (Near ICICI Bank)
Habsiguda Main Road, Habsiguda
HYDERABAD - 500 007
Andhra Pradesh
India
Phone  :    +91 40 6519 3368
Fax: +91 40 2715 0612



Pune


Data Patterns (India) Pvt. Ltd.

102/A, Surekha Appartment
Satara Road
Near Adinath Society
PUNE - 411 037
Maharashtra
India
 Phone: +91 20 4008 4424

(Disclaimer : This Job or placement paper has been sourced from various sources like print media, Job consultants, past candidates, our users and/ or Company website. The posted date above means the date on which the Job was posted on our site and not on the company site. Users are advised to check with the company for latest requirements before applying for the job. Our website will not be responsible for any loss to the company or the candidate. We have no relation with the company and are not responsible for the validity of this Job. We donot charge the company or candidate or any student anything. If the respective company has any issue with the data provided or they want this particular job or placement paper to be removed they can write into us at infinitecourses@gmail.com)

Comments / Reviews / Queries On

Click to See more Comments