Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
DotnetQ7
// WAP while loop to compute sum of first 5 natural numbers //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int j, sum = 0; Console.Write("\n\n"); Console.Write("Find the sum of first 5 natural numbers:\n"); Console.Write("----------------------------------------------"); Console.Write("\n\n"); Console.Write("The first 5 natural number are :\n"); for (j = 1; j <= 5; j++) { sum = sum + j; Console.Write("{0} ",j); } Console.Write("\nThe Sum is : {0}\n", sum); } } }
run
|
edit
|
history
|
help
0
zmeika
Fórum ➡ DataTable #1's rows that are NOT present in DataTable #2 ♦
Assignment 1
PhoneBook- Dictionary
Random number between IF Values
Find the missing number in an array1
asxsdsdxasd
ASCII -> Braille ASCII
math 5.74
xpath select element code