comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: integers into strings
Date: Thu, 02 Feb 2006 02:15:29 GMT
Date: 2006-02-02T02:15:29+00:00	[thread overview]
Message-ID: <5XdEf.326$UF1.191@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <1138844312.140458.73880@z14g2000cwz.googlegroups.com>

isaac_2004@yahoo.com wrote:

> hi im new to ada and i want to take a number inputted from a user and
> seperate the digits then arrange it in ascending and descending order
> and subtract and ascending number from the descending number
> 
> for example
> 
> user inputs 7319
> 
> program outputs   9731 - 1379 = 8352

'Image converts a scalar into a String; 'Value works the other way.

Integer'Image (7319) = " 7319". Integer'Value ("9731") = 9731.

However, if you're getting the number from input, you could just input it as a 
String and skip the 1st step.

-- 
Jeff Carter
"My name is Jim, but most people call me ... Jim."
Blazing Saddles
39



  reply	other threads:[~2006-02-02  2:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02  1:38 integers into strings isaac_2004
2006-02-02  2:15 ` Jeffrey R. Carter [this message]
2006-02-02  3:43   ` isaac2004
2006-02-02  5:48     ` Simon Wright
2006-02-02 19:32     ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox