Answer to Question #273667 in C# for Scott

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,



1
Expert's answer
2021-11-30T18:41:09-0500

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

Answer:

B)11,1,11,11


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS