AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
C# Programming
What is the Size of ‘Char’ datatype?
8 bit
12 bit
16 bit
20 bit
Answer: Option (C)
Choose the output for the following set of code.
staticvoid Main(string[] args)
{
char c = 'g'
string s = c.ToString();
string s1 ="I am a human bein"+ c;
Console.WriteLine(s1);
Console.ReadLine();
}
I am a human bein c
I am a human being
I am a human being c
I am a human bein
‘g’is stored in character variable ‘c’ which later on is converted to string using method Convert.Tostring() and hence appended at last of the string in s1. Output: I am a human being.
Select the correct differences between char and varchar datatypes?
1. varchar is non unicode and char is unicode character datatype
2. char is ‘n’ bytes whereas varchar is actual length in bytes of data entered in terms of storage size
3. varchar is variable in length and char is the fixed length string
4. For varchar, if a string is less than the maximum length then it is stored in verbatim without any extra characters while for char if a string is less than the set length it is padded with extra characters to equalize its length to given length
1,3,4
2,3,4
1,2,4
3,4
Answer: Option (D)
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Nagpur"; String s2; s2 = s1.Insert(6, "Mumbai"); Console.WriteLine(s2);
NagpurMumbai
NagpuMumbair
Mumbai
Nagpur
Answer: Option A
Explanation:
No answer description available for this question.
The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder class are mutable.
True
False
String s1 = "ALL MEN ARE CREATED EQUAL"; String s2; s2 = s1.Substring(12, 3); Console.WriteLine(s2);
ARE
CRE
CR
CREATED
Answer: Option B
What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication { class SampleProgram { staticvoid Main(string[ ] args) { string str= "Hello World!"; Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() ); } } }
0
1
Hello World?
System.Int32
Answer: Option D
String s1="Kicit"; Console.Write(s1.IndexOf('c') + " "); Console.Write(s1.Length);
3 6
2 5
3 5
2 6
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies