can we assign null value to value type in c#?

Answer Posted / narayana

Yes We can Assign
A nullable int can store null. Nullable types in the C#
language can be constructed by specifying the question mark
after a value type in a declarator statement. The nullable
int can be specified with the syntax "int?".

Example:
int a=b=10;
int? c= null;
c=a+b

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between asp net and c#?

493


What are annotations in c#?

525


Define Virtual folder?

635


What is the difference between out and ref in c#?

485


What is the purpose of the integer parse method the decimal parse method?

526






Is it true that all c# types derive from a common base class?

532


What is a callback c#?

545


What are the 3 different types of arrays?

565


What does private void mean in c#?

544


What are namespaces, and how they are used?

571


What is static class in C#?

570


What is the use of command builder?

543


how to stored and retrive video in Sql server using asp.net c#......?

530


When Should You Call The Garbage Collector In .net?

553


Write down the c# syntax to catch an exception

527