what will be the output of the given below coding.
using System;
public class Exercise
{
static void OddNumbers(int a)
{
if (a >= 1)
{
Console.Write("{0}, ", a);
a -= 2;
OddNumbers(a);
}
}
public static int Main()
{
const int Number = 9;
Console.WriteLine("Odd Numbers");
OddNumbers(Number);
Console.WriteLine();
return 0;
}
}
Answer Posted / nitish yadav
9,7,5,3,1
Is This Answer Correct ? | 16 Yes | 1 No |
Post New Answer View All Answers
Can we inherit private members of class in c#?
Does c# support try-catch-finally blocks?
Explain the difference between abstract class and interface.
What is Named parameter in C#?
Why do we use class in c#?
Is boxing an implicit conversion?
Which program construct must return a value?
What is the difference between console application and windows application?
What happens if a static constructor throws an exception?
What is extension method in c# and how to use them?
How long does it take to get a loop recorder put in?
What is the use of tryparse in c#?
What is the advantage of static class in c#?
What happens if the inherited interfaces have conflicting method names?
Is an interface a type c#?