Input:
enter the value:1234
output:
1
2
3
4
write a program to get above output.....

Answers were Sorted based on User's Feedback



Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.......

Answer / mahesh.b.p.c

static void Main(string[] args)
{
string value= Console.ReadLine();
foreach(object num in value)
{
Console.WriteLine(num);
Console.WriteLine();
}
Console.Read();

}

Is This Answer Correct ?    11 Yes 4 No

Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.......

Answer / arunbabu.k

static void Main(string[] args)
{
Console.WriteLine("Enter text/numbers");
string str1=Console.ReadLine();
char[] ch_str = new char[str1.Length];
ch_str = str1.ToCharArray();
for (int num = 0; num < str1.Length;num ++ )
{
Console.WriteLine(ch_str [num]);
}
Console.Read();
}

Is This Answer Correct ?    4 Yes 2 No

Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.......

Answer / chandan

public static void Main()
        {
            string str = Console.ReadLine();
            foreach (var obj in str)
            {
                Console.Write(obj.ToString());
                Console.WriteLine();
            }
            Console.ReadLine();
        }

Is This Answer Correct ?    1 Yes 0 No

Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.......

Answer / bala

static void Main(string[] args)
{
string value = Console.ReadLine();
foreach (var num in value)
{
Console.Write(num + " ");
}
Console.Read();

}

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More OOPS Interview Questions

What are the 3 principles of oop?

0 Answers  


what is the application of oops?

8 Answers   IBM,


Can private class be inherited?

0 Answers  


When is a memory allocated to a class?

11 Answers  


Is react oop?

0 Answers  






what is difference between thread and programme.

1 Answers   NCC,


What is DeadlyDiamondDeathProblem ?

1 Answers  


What are the components of marker interface?

0 Answers  


Write pseudo code for push in a stack?

2 Answers   emc2,


What is this interview room ? Is it a class or an object.

3 Answers   CybAge, NSN, Wipro,


Define a class to represent a bank account. Include the following members: Data Members: Name of the Depositor Account Number Type of Account Balance amount in the account Member Functions: To assign the initial values. To deposit an account. To withdraw an amount after checking the balance. Write a C++ main program to display account number, name and balance.

6 Answers  


what is runtime polymorphism? For the 5 marks.

3 Answers  


Categories