Temenos Group Sample Programming Placement Paper Level1
-
Upload
placementpapersample -
Category
Documents
-
view
246 -
download
0
Transcript of Temenos Group Sample Programming Placement Paper Level1
-
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
1/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
TITLE:Temenos Group Sample Programming Placement Paper Level1
(Bolded option is your answer)
1.If the binary eauivalent of 5.375 in normalised form is 0100 0000
1010 1100 0000 0000 0000 0000, what will be the output of the
program (on intel machine)?
#include
#include
int main()
{
float a=5.375;char *p;
int i;
p = (char*)&a;
for(i=0; i
-
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
2/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A
#include
B
#include
C
#include
D
#include
3.How will you free the memory allocated by the following program?
#include
#include
#define MAXROW 3
#define MAXCOL 4
int main(){
int **p, i, j;
p = (int **) malloc(MAXROW * sizeof(int*));
return 0;
}
A memfree(int
p);
B dealloc(p); C malloc(p, 0); D free(p);
4.How many times "IndiaBIX" is get printed?
#include
int main()
{
int x;
for(x=-1; x
-
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
3/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
printf("IndiaBIX");
}
return 0;
}
A Infinite times B 11 times C 0 times D 10 times
5.How many times the while loop will get executed if a short int is 2
byte wide?
#include
int main(){
int j=1;
while(j
-
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
4/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
return 0;
}
A Infinite times B 32767 times C 65535 times D Till stackoverflows
7.Which of the following operations can be performed on the file
"NOTES.TXT" using the below code?
FILE *fp;
fp = fopen("NOTES.TXT", "r+");
A Reading B Writing C Appending D Read and
Write
8.To print out a and b given below, which of the following printf()
statement will you use?
#include
float a=3.14;
double b=3.14;
A printf("%f
%lf", a, b);
B printf("%Lf
%f", a, b);
C printf("%Lf
%Lf", a, b);
D printf("%f
%Lf", a, b);
9.Which files will get closed through the fclose() in the following
program?
#include
int main(){
FILE *fs, *ft, *fp;
fp = fopen("A.C", "r");
fs = fopen("B.C", "r");
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
5/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
ft = fopen("C.C", "r");
fclose(fp, fs, ft);
return 0;
}
A "A.C" "B.C"
"C.C"
B "B.C" "C.C" C "A.C" D Error in
fclose()
10.On executing the below program what will be the contents of
'target.txt' file if the source file contains a line "To err is human"?
#include
int main()
{
int i, fss;
char ch, source[20] = "source.txt", target[20]="target.txt", t;
FILE *fs, *ft;
fs = fopen(source, "r");
ft = fopen(target, "w");
while(1){
ch=getc(fs);
if(ch==EOF)
break;
else
{
fseek(fs, 4L, SEEK_CUR);
fputc(ch, ft);}
}
return 0;
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
6/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
}
A r n B Trh C err D None ofabove
11.Consider the following program and what will be content oft?
#include
int main()
{
FILE *fp;int t;
fp = fopen("DUMMY.C", "w");
t = fileno(fp);
printf("%d\n", t);
return 0;
}
A size of
"DUMMY.C" file
B The handle
associated with
"DUMMY.C" file
C Garbage value D Error in
fileno()
12.Which of the following is the correct output for the C#.NET code
snippet given below?
enum color
{
red,
green,
blue
}
color c;
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
7/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
c = color.red;
Console.WriteLine(c);
A 1 B -1 C red D 0
13.Which of the following will be the correct output for the C#.NET
code snippet given below?
enum color : int
{
red = -3,
green,blue
}
Console.Write( (int) color.red + ", ");
Console.Write( (int) color.green + ", ");
Console.Write( (int) color.blue );
A -3, -2, -1 B -3, 0, 1 C 0, 1, 2 D red, green,
blue
14.Which of the following is the correct output for the C#.NET code
snippet given below?
enum color: int
{
red,
green,
blue = 5,cyan,
magenta = 10,
yellow
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
8/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Console.Write( (int) color.green + ", " );
Console.Write( (int) color.yellow );
A 2, 11 B 1, 11 C 2, 6 D 1, 5
15.Which of the following is the correct output of the C#.NET code
snippet given below?
int[ , , ] a = new int[ 3, 2, 3 ];
Console.WriteLine(a.Length);
A 20 B 4 C 18 D 10
16.Which of the following is the correct output of the C#.NET code
snippet given below?
int[][] a = new int[2][];
a[0] = new int[4]{6, 1, 4, 3};
a[1] = new int[3]{9, 2, 7};
Console.WriteLine(a[1].GetUpperBound(0));
A 2 B 7 C 3 D 9
17.What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args){
int i, j;
int[ , ] arr = new int[ 2, 2 ];
for(i = 0; i < 2; ++i)
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
9/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
{
for(j = 0; j < 2; ++j)
{
arr[i, j] = i * 17 + i * 17;
Console.Write(arr[ i, j ] + " ");
}
}
}
}
}
A 0 0 34 34 B 0 0 17 17 C 0 0 0 0 D 17 17 0 0
18.Which of the following will be the correct output for the C#.NET
program given below?
namespace IndiabixConsoleApplication
{
class Sample
{int i;
Single j;
public void SetData(int i, Single j)
{
i = i;
j = j;
}
public void Display(){
Console.WriteLine(i + " " + j);
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
10/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(10, 5.4f);
s1.Display();
}
}
}A 0 0 B 10 5.4 C 10 5.400000 D 10 5
19.Which of the following will be the correct output for the C#.NET
program given below?
namespace IndiabixConsoleApplication
{
class Sample{
int i;
Single j;
public void SetData(int i, Single j)
{
this.i = i;
this.j = j;
}public void Display()
{
Console.WriteLine(i + " " + j);
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
11/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(36, 5.4f);
s1.Display();
}
}}
A 0 0.0 B 36 5.4 C 36 5.400000 D 36 5
20.What does the following C#.NET code snippet will print?
int i = 0, j = 0;
label:i++;
j+=i;
if (i < 10)
{
Console.Write(i +" ");
goto label;
}
A Prints 1 to 9 B Prints 0 to 8 C Prints 2 to 8 D Prints 2 to 9
21.Which of the following is the correct output for the C#.NET program
given below?
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
12/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
int i = 20 ;
for( ; ; )
{
Console.Write(i + " ");
if (i >= -10)
i -= 4;
else
break;
}
A 20 16 12 84 0 -4 -8 B 20 16 12 8 4 0 C 20 16 12 8 4 0-4 -8 -12 D 16 12 8 4 0
22.What is the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
public enum color
{ red, green, blue };
class SampleProgram
{
static void Main (string[ ] args)
{
color c = color.blue;
switch (c)
{
case color.red:Console.WriteLine(color.red);
break;
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
13/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
case color.green:
Console.WriteLine(color.green);
break;
case color.blue:
Console.WriteLine(color.blue);
break;
}
}
}
}A red B blue C 0 D 1
23.What will be the output of the C#.NET code snippet given below?
int val;
for (val = -5; val 0)
Console.Write ("B");else if (val < 0)
Console.Write ("X");
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
14/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A XXXXXIndia B IndiaBBBBB C
XXXXIndiaBBBB
B
D
BBBBBIndiaXXX
XX
24.What will be the output of the C#.NET code snippet given below?
char ch = Convert.ToChar ('a' | 'b' | 'c');
switch (ch)
{
case 'A':
case 'a':
Console.WriteLine ("case A | case a");break;
case 'B':
case 'b':
Console.WriteLine ("case B | case b");
break;
case 'C':case 'c':
case 'D':
case 'd':
Console.WriteLine ("case D | case d");
break;
}
A case A | case a B case B | case b C case D | case
d
D Compile Error
25.The C#.NET code snippet given below generates ____ numbers
series as output?
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
15/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
int i = 1, j = 1, val;
while (i < 25)
{
Console.Write(j + " ");
val = i + j;
j = i;
i = val;
}
A Prime B Fibonacci C Palindrome D Odd
26.What will be the output of the C#.NET code snippet given below?
int i = 2, j = i;
if (Convert.ToBoolean((i | j & 5) & (j - 25 * 1)))
Console.WriteLine(1);
else
Console.WriteLine(0);
A 0 B 1 C Compile Error D Run time
Error
27.void start() {
A a = new A();
B b = new B();
a.s(b);
b = null; /* Line 5 */
a = null; /* Line 6 */
System.out.println("start completed"); /* Line 7 */
}
When is the B object, created in line 3, eligible for garbage collection?
A after line 5 B after line 6 C after line 7 D There is no
way to be
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
16/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
28.class HappyGarbage01
{
public static void main(String args[])
{
HappyGarbage01 h = new HappyGarbage01();
h.methodA(); /* Line 6 */
}
Object methodA()
{
Object obj1 = new Object();
Object [] obj2 = new Object[1];obj2[0] = obj1;
obj1 = null;
return obj2[0];
}
}
Where will be the most chance of the garbage collector being invoked?
A After line 9 B After line 10 C After line 11 D Garbage
collector neverinvoked in
methodA()
29.class Bar { }
class Test
{
Bar doBar()
{
Bar b = new Bar(); /* Line 6 */return b; /* Line 7 */
}
public static void main (String args[])
{
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
17/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Test t = new Test(); /* Line 11 */
Bar newBar = t.doBar(); /* Line 12 */
System.out.println("newBar");
newBar = new Bar(); /* Line 14 */
System.out.println("finishing"); /* Line 15 */
}
}
At what point is the Bar object, created on line 6, eligible for garbage
collection?
A after line 12 B after line 14 C after line 7,
when doBar()completes
D after line 15,
when main()completes
30.public class X
{
public static void main(String [] args)
{
X x = new X();
X x2 = m1(x); /* Line 6 */
X x4 = new X();x2 = x4; /* Line 8 */
doComplexStuff();
}
static X m1(X mx)
{
mx = new X();
return mx;
}}
After line 8 runs. how many objects are eligible for garbage collection?
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
18/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A 0 B 1 C 2 D 3
31.public Object m(){
Object o = new Float(3.14F);
Object [] oa = new Object[l];
oa[0] = o; /* Line 5 */
o = null; /* Line 6 */
oa[0] = null; /* Line 7 */
return o; /* Line 8 */
}When is the Float object, created in line 3, eligible for garbage
collection?
A just after line
5
B just after line
6
C just after line
7
D just after line
8
32.class X2
{
public X2 x;
public static void main(String [] args)
{
X2 x2 = new X2(); /* Line 6 */
X2 x3 = new X2(); /* Line 7 */
x2.x = x3;
x3.x = x2;
x2 = new X2();
x3 = x2; /* Line 11 */
doComplexStuff();
}
}
after line 11 runs, how many objects are eligible for garbage collection?
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
19/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A 0 B 1 C 2 D 3
33.What will be the output of the program?
class PassA
{
public static void main(String [] args)
{
PassA p = new PassA();
p.start();
}
void start()
{
long [] a1 = {3,4,5};
long [] a2 = fix(a1);
System.out.print(a1[0] + a1[1] + a1[2] + " ");
System.out.println(a2[0] + a2[1] + a2[2]);
}
long [] fix(long [] a3)
{
a3[1] = 7;
return a3;
}
}
A 12 15 B 15 15 C 3 4 5 3 7 5 D 3 7 5 3 7 5
34.What will be the output of the program?
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
20/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
class Test
{
public static void main(String [] args)
{
Test p = new Test();
p.start();
}
void start()
{
boolean b1 = false;boolean b2 = fix(b1);
System.out.println(b1 + " " + b2);
}
boolean fix(boolean b1)
{
b1 = true;
return b1;}
}
A true true B false true C true false D false false
35.What will be the output of the program?
class PassS
{public static void main(String [] args)
{
PassS p = new PassS();
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
21/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
p.start();
}
void start()
{
String s1 = "slip";
String s2 = fix(s1);
System.out.println(s1 + " " + s2);
}
String fix(String s1){
s1 = s1 + "stream";
System.out.print(s1 + " ");
return "stream";
}
}
A slip stream B slipstream
stream
C stream slip
stream
D slipstream
slip stream36.What will be the output of the program?
class Test
{
public static void main(String [] args)
{
int x=20;
String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";System.out.println(sup);
}
}
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/ -
7/29/2019 Temenos Group Sample Programming Placement Paper Level1
22/22
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget
freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @
https://www.facebook.com/LatestOffCampus
A small B tiny C huge D Compilation
fails
http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/