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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1885


What is the renewal class?

2413


What is a class and object?

794


What is class and object with example?

818


What is ambiguity in inheritance?

849


What are objects in oop?

827


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

1855


What are the 4 pillars of oop?

888


what is difference between class template and template class?

2398


Can we create object of interface?

843


What is variable example?

788


What is oops and why we use oops?

784


Why is polymorphism used?

777


What is advantage of inheritance?

938


Why is polymorphism needed?

793