i
LTIMindtree
Filter interviews by
posted on 15 Mar 2015
Program to display prime numbers from 1-35
Loop through numbers 1-35
Check if each number is prime
If prime, display the number
A program to reverse a string
Create an empty string to store the reversed string
Loop through the original string from the end to the beginning
Add each character to the new string
Return the new string
Polymorphism is the ability of an object to take on many forms.
Polymorphism allows objects of different classes to be treated as if they are of the same class.
It can be achieved through method overloading or method overriding.
Example: A shape class can have different subclasses like circle, square, triangle, etc. and all can be treated as shapes.
Polymorphism helps in achieving code reusability and flexibility.
Yes, method overloading is possible in C++.
Method overloading allows multiple functions with the same name but different parameters.
The compiler determines which function to call based on the number and types of arguments passed.
Example: void print(int x), void print(float x), void print(char x) can all be overloaded.
Overloading can also be done with operators like +, -, *, /, etc.
Overloading improves code readability
I will use software tools that are relevant to my BE project.
The software tools I will use will depend on the nature of my BE project.
For example, if my project involves designing a circuit, I may use software like LTSpice or Proteus.
If my project involves programming, I may use software like Visual Studio or Eclipse.
I will also use software for data analysis and visualization, such as MATLAB or Python.
Ultimately, I wi...
Yes, we can write int func() and int func(int a) in a single class.
We can overload the function with different parameters.
The function with no parameter is called default constructor.
Example: class MyClass { int func(); int func(int a); };
Both functions can have different implementations.
Java code can be inserted in HTML using