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


Please Help Members By Posting Answers For Below Questions

Can we inherit private members of class in c#?

583


Does c# support try-catch-finally blocks?

480


Explain the difference between abstract class and interface.

600


What is Named parameter in C#?

554


Why do we use class in c#?

482






Is boxing an implicit conversion?

547


Which program construct must return a value?

572


What is the difference between console application and windows application?

486


What happens if a static constructor throws an exception?

496


What is extension method in c# and how to use them?

476


How long does it take to get a loop recorder put in?

467


What is the use of tryparse in c#?

466


What is the advantage of static class in c#?

515


What happens if the inherited interfaces have conflicting method names?

572


Is an interface a type c#?

519