I want to single value if you give any integer value. Below are examples
1. Input: 123 Output: 6
2. Input: 99 9+9=18 1+8 Output: 9
How to get above output?
Answer / vamshireddy
console.writeline("enter ur number");
int i=int.parse(console.readline);
int add=0;
int rem=0;
while(i!=0);
{
rem=i%10;
add=add+rem;
i=i/10;
}
console.writeline("result is"+add);
console.readline();
Is This Answer Correct ? | 5 Yes | 0 No |
One start and stop button is there and one textbox is there.when you click start button ,it will display 1,2,3......up to infinite in textbox.when you click stop button it will stop.
What are the methods in c#?
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
Is list ienumerable c#?
What is icomparer in c#?
What is the data provider name to connect to access database?
What is an ienumerable in c#?
What is a byte in c#?
What is difference between value and reference types?
Explain the use of virtual, sealed, override, and abstract method?
What is serializable in c#?
What is constructors, explain with syntax