Question #273667

1)Which of the following will be the correct output for the c#.Net program given below?

namespace IndiabixConsoleApplication

class sampleProgram{

static void main(string[] args) {

int num = 1;

funcv(num);

console.write(num +",");

funcr(ref num);

console.Write(num +",");

}

static void funcv(int num){

num = num + 10; Console.Write(num +","); }

static void funcr (ref int num) {

num = num + 10;

Console.Write(num +","); }

}

A)1,1,1,1, B)11,1,11,11, C)11,11,11,11, D)11,11,21,11, E)11,11,21,21,



Expert's answer

This code will be compiled after some errors in the code have been corrected.

Answer:

B)11,1,11,11


LATEST TUTORIALS
APPROVED BY CLIENTS