Question
int a = 10;
int b = 20;
bool c;
c = !(a > b);
1. There is no error in the code snippet.
2. An error will be reported since ! can work only with an int.
3. A value 1 will be assigned to c.
4. A value True will be assigned to c.
5. A value False will be assigned to c.
a.
1, 3
b.
2, 4
c.
4, 5
d.
1, 4
Posted under Data Types,Variables and Operators C# programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Which of the following statements are correct about the following code snippet? int a = 10; int b = 20; bool c; c = !(a > b); 1. There is no error in the code...
Similar Questions
Discover Related MCQs
Q. Which of the following statements is correct about Bitwise ^ operator used in C#.NET?
View solution
Q. How many Bytes are stored by ‘Long’ Datatype in C# .net?
View solution
Q. Choose “.NET class” name from which datatype “UInt” is derived ?
View solution
Q. Correct Declaration of Values to variables ‘a’ and ‘b’?
View solution
Q. Arrange the following datatype in order of increasing magnitude sbyte, short, long, int.
View solution
Q. Which datatype should be more preferred for storing a simple number like 35 to improve execution speed of a program?
View solution
Q. Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?
1) Int32.Parse() is only used for strings and throws argument exception for null string
2) Convert.Int32() used for datatypes and returns directly ‘0’ for null string
View solution
Q. Correct way to assign values to variable ‘c’ when int a=12, float b=3.5,int c;
View solution
Q. Correct Set of Code for given data ‘a’ and ‘b’ to print output for ‘c’ as 74 ?
View solution
Q. Default Type of number without decimal is ?
View solution
Q. Select a convenient declaration and initialization of a floating point number:
View solution
Q. Number of digits upto which precision value of float datatype is valid ?
View solution
Q. Valid Size of float datatype is ?
View solution
Q. Correct way to define a value 6.28 in a variable ‘pi’ where value cannot be modified ?
View solution
Q. Minimum and Maximum range of values supported by ‘float’ data type are ?
View solution
Q. Select appropriate difference between decimal, float and double data type in C# ?
1) Float and Double are floating binary point types while decimal is a floating decimal point type.
2) Precision difference for float is ‘7’ digit for double is ’15’ to ’16’ digit and for decimal is ’28’ to ’29’ digits.
3) Some values which cannot be exactly represented hence for those values float and double are more appropriate.
View solution
Q. A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored ?
View solution
Q. The Default value of Boolean DataType is ?
View solution
Q. Which of the following format specifiers is used to print hexadecimal values and return value of output as Octal equivalent in C# ?
View solution
Q. What is the Size of ‘Char’ datatype?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!