Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?



I want to single value if you give any integer value. Below are examples  1. Input: 123  Ou..

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

Post New Answer

More C Sharp Interview Questions

Is c# good for web development?

0 Answers  


How can I get around scope problems in a try/catch?

0 Answers  


What is the difference between String s(Small s) and String S(Capital S)?

4 Answers  


How can you read 3rd line from a text file?

0 Answers  


Can private virtual methods be overridden in c#.net?

0 Answers  


Define property in c#.net?

0 Answers  


What is Delegate and what is it used for ?

0 Answers   NA,


Why is hashset faster?

0 Answers  


from web.config file with connection string who to interact means who to connect in gridview. in my system shows null something error what is the problem

3 Answers   Bally Technologies,


What is ienumerable t in c#?

0 Answers  


Why do we use threads in c#?

0 Answers  


how to retrieve binary data from database (using c#.net and sql server/windows application)

2 Answers   Soltius,


Categories