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

Is struct object oriented?

473


What is the difference between interface and functional interface?

483


How do you sort an array in c#?

491


How many types of constructors are there?

506


Is datetime nullable c#?

498






Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?

502


Is string a class in c#?

472


What does this keyword mean in c#?

515


Why do we use inheritance in c#?

477


How to find the current application file path while runtime?

495


What is difference between assembly and namespace?

469


Explain About DTS package

574


What does protected internal access modifier mean?

543


What is the difference between firstordefault and singleordefault?

476


What are constructors in c#?

534