Day 2
Day 2
Roop Lal
Assistant Professor-CSE 3rd
Years.
Wipro Certificated.
1
C#
University of Virginia
A data type specifies the type of
data that a variable can store
such as integer, floating,
character etc.
•Q.2. Write a program that asks the user to enter a decimal number. If
the input is a valid double, print "Valid double: [value]". If not, print
"Invalid input".
Q.3. Write a program that asks the user to enter a boolean value (true or
false). If the input is a valid boolean, print "Valid boolean: [value]". If not,
print "Invalid input.
Q.4 Write a program that asks the user to enter a date and time. If the
input is a valid DateTime, print "Valid DateTime: [value]". If not, print
"Invalid input".
C#
University of Virginia
17
C#
University of Virginia
C#
University of Virginia18
C#
University of Virginia19
C#
University of Virginia20
C#
University of Virginia21
C#
University of Virginia22
C#
University of Virginia23
C#
University of Virginia24
C#
University of Virginia25
.
26
C#
University of Virginia