Last active
October 23, 2017 04:10
-
-
Save atiq-cs/9b675f8582d52c831e57a6c1eeadfeb3 to your computer and use it in GitHub Desktop.
a test from wiziq.com - first question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Question 1 of a C# Test | |
| What will be outputs | |
| 0 | |
| 10 | |
| 60 | |
| Possibly from: wiziq.com | |
| */ | |
| using System; | |
| using System.Collections.Generic; | |
| class Solution { | |
| public static void Add(int a, int b) { | |
| Console.WriteLine(a + b); | |
| } | |
| public static void Add(params int[] val) | |
| { | |
| int sum = 0; | |
| foreach (var item in val) | |
| sum += item; | |
| Console.WriteLine(sum); | |
| } | |
| static void Main(string[] args) { | |
| Add(); | |
| Add(4, 6); | |
| Add(10, 20, 30); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment