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
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 |
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 |
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 |
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 |
Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku
What are objects in oop?
How to create a comment page in C #??
What are the types of abstraction?
What is abstraction oop?
What does the keyword "static" mean?
What is class in oop with example?
What is multilevel inheritance in oop?
#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; wow *b; a.x = 22; b = &a; a.x = 23; cout << b->x; return 0; }
In which Scenario you will go for Interface or Abstract Class?
1 Answers InfoAxon Technologies,
What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Compiler error: Lvalue required
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?