/ Published in: C#
                    
                                        
my take on fizzbuzz written in C#.Net - Razor
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<div>
@{
var end = 100;
for (int i = 1; i < end; i++)
{
<span>@i</span>
if (i % 5 == 0 && i % 3 == 0)
{
<span>fizzbuzz</span>
}
else if (i % 3 == 0)
{
<span>fizz</span>
}
else if (i % 5 == 0)
{
<span>buzz</span>
}
else
{
<span>@i</span>
}
<br />
}
}
</div>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                