Home
MCQS
C MCQ Quiz Hub
Choose a topic to test your knowledge and improve your C skills
1. A variable which is declared inside a method is called a________variable
Serial
Local
Private
Static
2. Which is the String method used to compare two strings with each other ?
Compare To()
Compare()
Copy()
ConCat()
3. Minimum and Maximum range of values supported by ‘float’ data type are ?
1.5 * 10 ^-40 to 3.4 * 10 ^38
1.5 * 10 ^-40 to 3.4 * 10 ^38
1.5 * 10 ^-45 to 3.4 * 10 ^38
1.5 * 10 ^-45 to 3.4 * 10 ^37
4. Which datatype should be more preferred for storing a simple number like 35 to improve execution speed of a program?
sbyte
short
int
long
5. What will be output of the following conversion ? static void Main(string[] args) { char a = 'A'; string b = "a"; Console.WriteLine(Convert.ToInt32(a)); Console.WriteLine(Convert.ToInt32(Convert.Tochar(b))); Console.ReadLine(); }
1, 97
65, 97
65, 97
97, 1
6. Scope of variable is related to definition of variable as: 1. Region of code within which variable value is valid and hence can be accessed. 2. No, relation with region where variable is declared its value is valid in entire scope.
a
b
a, b
None of the mentioned
7. Type of Conversion in which compiler is unable to convert the datatype implicitly is ?
ushort to long
int to uint
ushort to long
byte to decimal
8. Select output of the given set of Code : static void Main(string[] args) { String name = "r4r"; Console.WriteLine("Good Morning" + name); }
r4r
Good Morning
Good Morning r4r
Good Morning name
9. Which of the following is NOT an Integer?
Char
Byte
Integer
Short
10. Which of the following are value types? 1.Integer 2.Array 3.Single 4.String 5.Long
1, 2, 5
1, 3, 5
2, 4
3, 5
11. Which of the following statements is correct?
When a class inherits an interface it inherits member definitions as well as its implementations.
An interface cannot contain the signature of an indexer.
Interfaces members are automatically public.
To implement an interface member, the corresponding member in the class must be public as well as static.
12. Which of the following can implement an interface? 1.Data 2.Class 3.Enum 4.Structure 5.Namespace
1, 3
2, 4
3, 5
4 only
Submit