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,
This code will be compiled after some errors in the code have been corrected.
Answer:
B)11,1,11,11
Comments
Leave a comment