Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What will be the output of the given code snippet?

class math

{

public int fact(int n)

{    int result;

result = fact(n -1)* n;

return result;

}

}

class Program

{

staticvoid Main(string[] args)

{

maths obj =new maths();

Console.WriteLine(obj.fact(4));

Console.ReadLine();

}

}

 

c) Compile time error

d) Runtime Error

user-image
Question added by Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
Date Posted: 2016/10/21
Pathan Zarrar Khadar Khan
by Pathan Zarrar Khadar Khan , Windows System Administrator , Dyce Tech Pvt Ltd

A ,                                                                             Compile Time error

Shaikh Mohammad Asif Zafre Alam
by Shaikh Mohammad Asif Zafre Alam , software engineer , Inceptio systems DMCC

compile time error compile time error

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.