TVS Previous Years Solved Sample Placement Papers
-
Select the query which allows you to select rownum and employee name (empname) from a record(emp)?
A: select rownum, enum from emp;
B: select colnum, ename from emp;
C: select colname, enum from emp;
D: select rownum, ename from emp;
Ans: D -
What does a one-to-one relationship indicate?
A: More entities are needed.
B: The model should be denormalized.
C: The tables are not properly indexed.
D: The model cannot be implemented physically.
Ans: B -
What clause do you use in the query to help avoid a table scan?
A: GROUP BY clause
B: HAVING clause
C: FROM clause
D: WHERE clause
Ans: D -
What will be the output of the following C# code?
using System; namespace MyApplication { class Program { static void Main(string[] args) { bool x = true; Console.Write(Convert.ToString(x)); } } }
A: True
B: true
C: False
D: false
Ans: A) TrueExplanation: In the above C# code, we are using
Convert.ToString()
method which converts abool
tostring
. Thus, the output will be "True". -
What will be the output of the following C# code?
using System; namespace MyApplication { class Program { static void Main(string[] args) { double x = 10.25; Console.Write(Convert.ToInt32(x)); } } }
A: 10.30
B: 10.25
C: 10
D: Error
Ans: C) 10Explanation: In the above C# code, we are using
Convert.ToInt32()
method which converts adouble
toint
. Thus, the output will be "10". -
What is 'Console' in C#?
A: Class
B: Object
C: Method
D: Structure
Ans: A) ClassExplanation: In C#, the
Console
class is used to represent the standard input, output, and error streams for console applications. -
What will be the output of the following C# code, if the input is 123?
using System; namespace MyApplication { class Program { static void Main(string[] args) { Console.WriteLine("Enter a number:"); int num = Console.ReadLine(); Console.WriteLine("Given number is: " + num); } } }
A: Given number is:123
B: Given number is: 123
C: Given number is: "123"
D: Error
Ans: D) ErrorExplanation: In C#,
Console.ReadLine()
is used to read astring
. Here, we are trying to assign the input to anint
variable directly, which causes an error. The error is:Cannot implicitly convert type 'string' to 'int'
. -
What will be the output of the following C# code, if the input is 123?
using System; namespace MyApplication { class Program { static void Main(string[] args) { Console.WriteLine("Enter a number:"); int num = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Given number is: " + num); } } }
A: Given number is:123
B: Given number is: 123
C: Given number is: "123"
D: Error
Ans: B) Given number is: 123Explanation: In C#,
Console.ReadLine()
reads input as astring
. UsingConvert.ToInt32()
, we convert the input to anint
, so there is no error. Output will be:Given number is: 123
. -
Which is/are the correct method(s) to input a float value in C#?
A:
Parse(Console.ReadLine())
B:
ToSingle(Console.ReadLine())
C:
ToFloat(Console.ReadLine())
D: Both A and B
E: Both A and C
Ans: D) Both A and BExplanation: In C#, the following methods can be used to input a float value:
float.Parse(Console.ReadLine())
: Parses a string to a float.Convert.ToSingle(Console.ReadLine())
: Converts a string to a single-precision floating-point number.
ToFloat(Console.ReadLine())
is not a valid method in C#. -
What is the output of the program?
void main() { int const *p = 5; cout << ++(*p); }
A: 5
B: Memory value
C: Compiler error
D: Garbage value
Ans: [Your Answer] -
What is the output of the program?
main() { char s[] = "man"; int i; for(i = 0; s[i]; i++) cout << s[i]; }
A: mmmm aaaa nnnn
B: man
C: Compiler error
D: None of the above
Ans: [Your Answer] -
What is the output of the program?
main() { float me = 1.1; double you = 1.1; if(me == you) cout << "I love U"; else cout << "I hate U"; }
A: I hate U
B: I love U
C: Garbage value
D: None of the above
Ans: [Your Answer] -
C# is a programming language, developed by ___.
A: Oracle
B: Microsoft
C: GNU project
D: Google
Ans: B -
C# runs on the ___.
A: .NET Framework
B: Java Virtual Machine
C: Both A and B
D: None of the above
Ans: A -
C# programming language is used to develop:
A: Web apps
B: Desktop apps
C: Mobile apps
D: All of the above
Ans: D -
Is C# an object-oriented programming language?
A: Yes
B: No
Ans: A -
Select the query through which you can display the records within a given range?
A: select row from emp where rowname <=&rangeend
B: select row from emp where rowname <&rangeend
C: select column from emp where rowname &rangeend
D: select column from emp where rowname <=&rangeend
Ans: A