5
Answers

How to Print 1 to 100 numbers using MVC 4/5?

bhimani samba

bhimani samba

9y
833
1
Hi,How to Print 1 to 100 numbers using MVC 4/5?
print format:
1      11  ........91
2      12           92
3      13           93
4      14
5      15 
6
7
8
9
10  20 ........100
Answers (5)
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 7y
var is a keyword which is anonymous type and was introduced in C# 3.0. var is used to declare implicitly typed local variable means it tells the compiler to figure out the type of the variable at compilation time. A var variable must be initialized at the time of declaration which decide data type.
 
It is mostly helpful when you write LINQ statements and you need customised results, follow below snippets: 
  1. var empQuery =   
  2.     from emp in employees  
  3.     select new { prod.Name, prod.Qual};  
  4.   
  5. foreach (var v in empQuery)  
  6. {  
  7.     Console.WriteLine("Name={0}, Price={1}", v.Name, v.Qual);  
  8. }  
 
Next Recommended Forum