Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
QuestionINotifyPropertyChanged, attributes and notification cascade Pin
N4sh22-Jan-10 9:15
N4sh22-Jan-10 9:15 
Questionhow to split input integer variable Pin
arungracy22-Jan-10 9:15
arungracy22-Jan-10 9:15 
AnswerRe: how to split input integer variable Pin
loyal ginger22-Jan-10 9:22
loyal ginger22-Jan-10 9:22 
GeneralRe: how to split input integer variable Pin
Som Shekhar22-Jan-10 9:39
Som Shekhar22-Jan-10 9:39 
AnswerRe: how to split input integer variable Pin
#realJSOP22-Jan-10 10:23
mve#realJSOP22-Jan-10 10:23 
GeneralRe: how to split input integer variable Pin
Luc Pattyn22-Jan-10 10:46
sitebuilderLuc Pattyn22-Jan-10 10:46 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 11:05
mve#realJSOP22-Jan-10 11:05 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP22-Jan-10 10:36
mve#realJSOP22-Jan-10 10:36 
Here's the "pointless math exercise" version:

int value = 12345;
double i = 1;
double power = 0;
List<int> digits = new List<int>();
while (value > 0)
{
	power = Math.Pow(10d, i);
	digits.Add(value % (int)power);
	value = (int)((double)value / power);
}
digits.Reverse();


EDIT =======================

This is clearly a homework assignment, and to be brutally honest, I see no future for you in programming. If you can't analyze and solve such a simple math problem, you have no business working as a programmer. Yeah, I provided you with the answer, but don't mistake this for a kindness on my part. In fact, I strongly advise you to share this code with your classmates, because if I see this particular request again, I cannot guarantee that I will be kind *or* understanding.

EDIT =======================

Changed digits.Sort() to digits.Reverse().

.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

modified on Saturday, January 23, 2010 7:52 AM

GeneralRe: how to split input integer variable [modified] Pin
Luc Pattyn22-Jan-10 11:32
sitebuilderLuc Pattyn22-Jan-10 11:32 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 12:46
mve#realJSOP22-Jan-10 12:46 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP23-Jan-10 2:16
mve#realJSOP23-Jan-10 2:16 
AnswerRe: how to split input integer variable Pin
#realJSOP23-Jan-10 5:04
mve#realJSOP23-Jan-10 5:04 
Questionget data from SSRS report Pin
Mohamed El-Wehishy22-Jan-10 7:20
Mohamed El-Wehishy22-Jan-10 7:20 
QuestionA Dialog bug (Edited) Pin
Muammar©22-Jan-10 7:04
Muammar©22-Jan-10 7:04 
AnswerRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 7:20
Som Shekhar22-Jan-10 7:20 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:10
Muammar©22-Jan-10 20:10 
GeneralRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 20:16
Som Shekhar22-Jan-10 20:16 
AnswerRe: A Dialog bug (Edited) Pin
loyal ginger22-Jan-10 7:26
loyal ginger22-Jan-10 7:26 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani22-Jan-10 7:47
professionalRavi Bhavnani22-Jan-10 7:47 
GeneralRe: A Dialog bug (Edited) Pin
loyal ginger22-Jan-10 8:08
loyal ginger22-Jan-10 8:08 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani22-Jan-10 8:11
professionalRavi Bhavnani22-Jan-10 8:11 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:30
Muammar©22-Jan-10 20:30 
GeneralRe: A Dialog bug (Edited²) Pin
Ravi Bhavnani23-Jan-10 5:16
professionalRavi Bhavnani23-Jan-10 5:16 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani23-Jan-10 5:23
professionalRavi Bhavnani23-Jan-10 5:23 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©23-Jan-10 5:46
Muammar©23-Jan-10 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.