Previous Years Solved Sample Placement Papers
-
What is the output of the program
```c
void main()
{
char s[]="oracle is the best";
char t[40];
char *ss,*tt;
while(*tt++=*ss++);
printf("%s",t);
getch();
}
```
(a) oracle is the best
(b) Core dump (Ans)
(c) Error Message
(d) Goes into infinite loop
-
What is the output of the program
```c
void main()
{
int j[10]={9,7,5,3,1,2,4,6,9};
int i=1;
clrscr();
for(;i<9;i++)
printf("%d ",--j[i++]);
getch();
}
```
(a) 6,2,1,5 (Ans)
(b) 6,2,1,5,7
(c) Error Message
(d) Core dump
-
What is the output of the program
```c
void main()
{
int i,j,k,n=5;
clrscr();
for(i=5;i>0;i--)
{
j=1(a) 00011
(b) 11110 (Ans)
(c) 11001
(d) 11100
-
What is the output of the program
```c
#include
#include void main() { int i=1*4/3-27%3^2+100*0.5-(4>3?1:2); clrscr(); printf("%d",i); getch(); } ``` (a) 49
(b) Compile error (Ans)
(c) 51
(d) 48
-
What is the output of the program
```c
#include
#include void main() { char *st1[3]= {"Hello","World","Oracle"}; *st1=st1[2]; st1[1]=*st1; free(st1[0]); free(st1[1]); clrscr(); printf("%s %s %s",st1,st1[1],st1[2]); getch(); } ``` (a) Garbage Garbage Oracle
(b) Oracle Oracle Oracle
(c) Hello World Oracle
(d) Core Dump: cannot Print after freeing the memory (Ans)
-
What is the output of the program
```c
#include
void main()
{
char buffer[10]={"Genesis"};
printf("%d",&buffer[4]-(buffer));
}
```
(a) 3
(b) 4
(c) 0
(d) Illegal pointer subtraction
-
What is the output of the program
```c
#include
main()
{
static int a[]={5,10,15,20};
int *ptr=a;
int **ptr_ptr=&ptr;
printf("\n %d",**ptr_ptr++);
}
```
(a) 5
(b) 10
(c) 15
(d) 6
-
What is the value of the expression
`1+2/3*4+1`
(a) 2
(b) 3
(c) 4
(d) 4.666666
(e) 5