IBS | Placement Papers


                                       
           
1. What is the output of the program
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
// c. Error Message
// D. Goes into infinite loop
Ans: B. core dump (Garbage value)
2. What is the output of the program
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
// B. 6,2,1,5,7
// c. Error Message
// D. core dump
Ans: A. 6,2,1,5
3. What is the output of the program
void main()
{
int i,j,k,n=5;
clrscr();
for(i=5;i>0;i--)
{
j=1<i;
k=n&j;
k==0?printf("0"):printf("1");
}
getch();
}
// A. 00011
// B. 11110
// c. 11001
// D. 11100
Ans: B. 11110
4. Each side of a rectangle is increased by 100% .By what percentage does the area increase?
Ans : 300%
5. Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel .What is the distance?
Ans : 315 feet.
6. Perimeter of front wheel =30, back wheel = 20. If front wheel revolves 240 times. How many revolutions will the back wheel take?
Ans: 360 times
7. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution
Ans: 36%
8. City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?
Ans: 130 years
9. Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet?
Ans: 3/2 hours
10. What is the output of the program
#include<stdio.h>
#include<conio.h>
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
// c. 51
// D. 48
Ans: b
11. What is the output of the program
#include<stdio.h>
#include<conio.h>
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: D
12. what is the output of ..
#include
void main()
{
char buffer[10]={"Genesis"};
printf("%d",&buffer[4]-(buffer));
}
a. 3
b. 4
c. 0
d. illegal pointer subtraction
13. what is the output for
#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
14. what is the value of expr..
1+2/3*4+1
a. 2
b. 3
c. 4
d. 4.666666
e. 5
15. If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey?
Ans: 48kmph
16. A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?
Ans: 6%
17. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?
Ans: 9
18. If A/B = 3/5,then 15A = ?
Ans : 9B
19. class A
{
public:
static int a;
A() {a=10};
};
int main()
{
A b;
Printf(“%d”,b.a);
Return 0;
}
Will the program compile?
a yes
b. no
20. What would be the output of the following program?
main()
{
int y=128;
const int x=y;
printf("%d",x);
}
a) 128 b) Garbage value c) Error d) 0
21. What is the difference between the following declarations?
const char *s;
char const *s;
Ans. No difference
IBS Software Placement Paper June 2011:-
22 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
23.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.
24 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));
4. 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
25. 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
26. 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
27. 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
28. 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
29. There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer circle?
Ans: 1 : 2
30. If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST .
Ans: 1:2
31. A worker is paid Rs.20/- for a full days work. He works 1,1/3,2/3,1/8.3/4 days in a week. What is the total amount paid for that worker ?
Ans : 57.50
32. What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned
Ans: Rs 66/-
33. 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen.
Ans: Cannot be determined.
34. The price of a product is reduced by 30% . By what percentage should it be increased to make it 100%
Ans: 42.857%
35. There is a square of side 6cm . A circle is inscribed inside the square. Find the ratio of the area of circle to square.
Ans. 11/14
36. There are two candles of equal lengths and of different thickness. The thicker one lasts of six hours. The thinner 2 hours less than the thicker one. Ramesh lights the two candles at the same time. When he went to bed he saw the thicker one is twice the length of the thinner one. How long ago did Ramesh light the two candles
Ans: 3 hours.
37. The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price ?
Ans: Rs 13.86/-
38. There are 6 red shoes & 4 green shoes . If two of red shoes are drawn what is the probability of getting red shoes
Ans: 6c2/10c2
39. To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol.
Ans : 15%
40. If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST .
Ans: 1:2
41. What is the output of the program
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
// c. Error Message
// D. Goes into infinite loop
Ans: B. core dump (Garbage value)
42. What is the output of the program
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
// B. 6,2,1,5,7
// c. Error Message
// D. core dump
Ans: A. 6,2,1,5
43. What is the output of the program
void main()
{
int i,j,k,n=5;
clrscr();
for(i=5;i>0;i--)
{
j=1<i;
k=n&j;
k==0?printf("0"):printf("1");
}
getch();
}
// A. 00011
// B. 11110
// c. 11001
// D. 11100
Ans: B. 11110
44. Each side of a rectangle is increased by 100% .By what percentage does the area increase?
Ans : 300%
45. Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel .What is the distance?
Ans : 315 feet.
46. Perimeter of front wheel =30, back wheel = 20. If front wheel revolves 240 times. How many revolutions will the back wheel take?
Ans: 360 times
47. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution
Ans: 36%
48. City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?
Ans: 130 years
49. Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet?
Ans: 3/2 hours
50. What is the output of the program
#include<stdio.h>
#include<conio.h>
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
// c. 51
// D. 48
Ans: b
51. What is the output of the program
#include<stdio.h>
#include<conio.h>
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: D
52. what is the output of ..
#include
void main()
{
char buffer[10]={"Genesis"};
printf("%d",&buffer[4]-(buffer));
}
a. 3
b. 4
c. 0
d. illegal pointer subtraction
53. what is the output for
#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
54. what is the value of expr..
1+2/3*4+1
a. 2
b. 3
c. 4
d. 4.666666
e. 5
55. If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey?
Ans: 48kmph
56. A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?
Ans: 6%
57. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?
Ans: 9
58. If A/B = 3/5,then 15A = ?
Ans : 9B
59. class A
{
public:
static int a;
A() {a=10};
};
int main()
{
A b;
Printf(“%d”,b.a);
Return 0;
}
Will the program compile?
a yes
b. no
60. What would be the output of the following program?
main()
{
int y=128;
const int x=y;
printf("%d",x);
}
a) 128 b) Garbage value c) Error d) 0
60 What is the difference between the following declarations?
const char *s;
char const *s;
Ans. No difference
 

About

Site Info

Placements Info Copyright © 2009 Community is Designed by Bie Converted To Community Galleria by Cool Tricks N Tips