techpreparation-homepage

Home  Interview Questions  Certifications  Aptitude Questions  Tutorials  Placement Papers  Search  Resume  Soft Skills  Video  Forum  Blog


IT Placement Papers

3i-Infotech Placement Papers
Accenture Placement Papers
Infosys Placement Papers
Adobe Placement Papers
                              .........More

Technical Interview Questions
Networking Interview Questions
C Interview Questions
                              .........More

Resume Guide for Jobseekers
Resume - Action words
Resume To-Do List
                              .........More

Soft Skills
Communication Skills
Leadership Skills
                              .........More

 

 

  

Dharma Placement Paper


Give the output of the programs in each case unless mentioned otherwise
1.
void main()
{
int d=5;
printf("%f",d);
}
Ans: Undefined

2.
void main()
{
int i;
for(i=1;i<4,i++)
switch(i)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i) case 4:printf("%d",i);
}
Ans: 1,2,3,4

3.
void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}
Ans: 6

4.
void main()
{
unsigned i=1; /* unsigned char k= -1 => k=255; */
signed j=-1; /* char k= -1 => k=65535 */
/* unsigned or signed int k= -1 =>k=65535 */
if(i<j)
printf("less");
else
if(i>j)
printf("greater");
else
if(i==j)
printf("equal");
}
Ans: less

5.
void main()
{
float j;
j=1000*1000;
printf("%f",j);
}

1. 1000000
2. Overflow
3. Error
4. None
Ans: 4

6. How do you declare an array of N pointers to functions returning
pointers to functions returning pointers to characters?

Ans: The first part of this question can be answered in at least
three ways:

1. char *(*(*a[N])())();

2. Build the declaration up incrementally, using typedefs:

typedef char *pc; /* pointer to char */
typedef pc fpc(); /* function returning pointer to char */
typedef fpc *pfpc; /* pointer to above */
typedef pfpc fpfpc(); /* function returning... */
typedef fpfpc *pfpfpc; /* pointer to... */
pfpfpc a[N]; /* array of... */

Page No :  1         2

Check Aptitude Interview Questions for more Aptitude Questions

Check Placement Papers for more IT Companies Paper.