How to find a number between two numbers?

I try to find the numbers between two given user numbers and multiply each of them, but my code so far wont allow me to separate the numbers multiply:

ex: the numbers are 5 and 10: my code gives me 5678910 together online.

How can I sneek the * between these numbers? I know that I am seriously close here's my work so far.

Any help is greatly appreciated.


import java.util.Scanner;

public class FindIt
{
Public Shared Sub main (string args [])
{
Console scanner = new Scanner (System.in);

int userNumber, finIn, finIn2, finIn3;

System.out.Print ("enter a lower limit > = 1 :"); ")


do
{

userNumber = console.nextInt ();

If (< 1 userNumber)
{
System.out.Print ("enter a lower limit > = 1 :"); ")
}

} while (< 1 userNumber);

System.out.println ("the lower limit is" + userNumber);
System.out.println ();
System.out.Print ("enter an upper limit > = 3 :"); ")
finIn = userNumber;
do
{

userNumber = console.nextInt ();

If (userNumber < 3)
{
System.out.Print ("enter an upper limit > = 3 :"); ")
}

} While userNumber < 3.

System.out.println ("the upper limit is" + userNumber);
System.out.println ();
finIn2 = userNumber;



int x, y;
y = 0;
for (x = finIn; x < = finIn2; x ++)

CallIncr();





}
}

Published by: 806590 on October 31, 2010 13:07

Published by: 806590 on October 31, 2010 13:09

Modified the code of the loop to as below

for (x = finIn + 1; x)< finin2;="">

Tags: Java

Similar Questions

  • Find the difference between two numbers (DBL)

    Hi all

    Is there a function in labview other than the subtraction function that can find the difference between the two numbers given?

    Thank you

    Davidson


  • How to find the difference between two dates in time except Sunday

    Hi all

    I have a table, as shown below.
    SQL> select * from test;
    
    TR_ID                                              CREATE_TIME                                                                       CODE
    -------------------------------------------------- --------------------------------------------------------------------------- ----------
    S12341                                             05-JUN-12 12.20.52.403000 AM                                                      1003
    S12342                                             11-JUN-12 11.15.33.182000 AM                                                      1003
    S12342                                             07-JUN-12 12.00.36.573000 PM                                                      1002
    S12343                                             20-JUN-12 12.34.37.102000 AM                                                      1003
    S12343                                             15-JUN-12 11.34.27.141000 PM                                                      1002
    S12344                                             01-JUL-12 10.01.06.657000 PM                                                      1002
    S12344                                             06-JUL-12 12.01.04.188000 AM                                                      1003
    S12341                                             31-MAY-12 11.20.38.529000 PM                                                      1002
    I would like to know the difference between same tr_ids create_time, which should give out in hours except Sunday.

    For example:

    TR_ID: S12344
    1002_Create_time: July 1, 12 PM 10.01.06.657000 (i.e. Sunday)
    1003_Create_time: 12.01.04.188000 AM 6 July 12

    1002 create time is 22:00 Sunday.

    If the query must exclude only the hours of Sunday which is 10 p.m. to Monday 00 h which is 2 Hrs.

    I tried the sub query after doing a search on this forum but I am not getting the desired output.
    SELECT count(*) FROM (SELECT ROWNUM RNUM,tr_id,create_time CT_1002 FROM test c WHERE c.tr_id='S12344' and 
    ROWNUM <= (select (cast(a.create_time as date)-cast((select create_time from test b where a.tr_id=b.tr_id and code=1002) as date)) 
    from test a where a.code=1003 and a.tr_id=c.tr_id) + 1) d 
    WHERE to_char(cast((select create_time from test e where e.tr_id=d.tr_id and code=1002) as date) + RNUM - 1, 'DY') NOT IN('SUN');
    Need help to get the desired o/p

    Hello

    If I unederstand the problem correctly, that's what you want:

    WITH       got_extrema     AS
    (
         SELECT       tr_id
         ,       CAST (MIN (create_time) AS DATE)     AS start_date
         ,       CAST (MAX (create_time) AS DATE)     AS end_date
         FROM       test
         GROUP BY  tr_id
    )
    SELECT       tr_id
    ,       start_date, end_date          -- If wanted
    ,       24 * ( ( ( TRUNC (end_date,   'IW')          -- Count -1 day for every full week
                        - TRUNC (start_date, 'IW')
                 )
               / -7
                  )
                + LEAST ( end_date               -- If end_date is a Sunday
                            , TRUNC (end_date, 'IW') + 6     -- consider it 00:00:00 on Sunday
                     )
                - CASE
                          WHEN  start_date >= TRUNC (start_date, 'IW') + 6     -- If start_date is a Sunday
                   THEN  TRUNC (start_date, 'IW') + 6               -- consider it 00:00:00 Sunday
                   ELSE  start_date
                      END
                )     AS total_hours
    FROM      got_extrema
    ;
    

    I guess that you don't need to worry about fractions of a second. As you did in the code you have posted, I am to convert the TIMESTAMP to date values, because of DATE arithmetic and functions are so much better than what is available for timestamps.

    Basically, it's just to find the number of days between start_date and end_date and multiplying by 24, with these twists:
    (a) 1 day is deducted for each week between start_date and end_date
    (b) if End_date is a Sunday, none of the end_date himself hours are counted
    (c) If start_date is a Sunday, then all the start_date himself hours are counted. Why these hours should be counted? Because 1 day is already being deducted for the week which includes start_date, which contains only this Sunday.

    TRUNC (dt, 'IW') is the beginning of the ISO week containing dt; in other words, 00:00:00 the or before the dt last Monday. This is not the NLS parameters.

    Of course, I can't test without some sample data and the exact results you want from these data. You may need a little something more If start_date and end_date are both on the same Sunday.
    Whenever you have a problem, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) of all of the tables involved.
    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.
    Always tell what version of Oracle you are using.
    See the FAQ forum {message identifier: = 9360002}

  • How to find the difference between two dates in the presentation layer

    Hi gurus,

    Hello to everyone. Today, I came with the new requirement.


    I need to know the difference between a date and the current date in the formula column application presentation layer.by.



    Thank you and best regards,
    Prates

    Hi Navin,

    TIMESTAMPDIFF function first determines the timestamp component that corresponds to the specified interval setting. For example, SQL_TSI_DAY corresponds to the day component and SQL_TSI_MONTH corresponds to the component "month".

    If you want to display the difference between two dates in days using SQL_TSI_DAY, unlike butterflies SQL_TSI_MONTH and so on...

    hope you understand...

    Award points and to close the debate, if your question is answered.

    See you soon,.
    Aravind

  • How to find the time between two channels of entry in the data acquisition card or pci 6036

    Hello

    I read a lot-related posts on the simultaneous measurement of two input voltage of similar channels in map data acquisition. I know that the best material is "simultaneous measurments of the Series DAQ cards" but I only pci data acquisition card 6036 and I try to understand what is the time between the reading of the two channels . This period is always constant? (must it rely on a voltage (amplitude, frequency, waveform..). I send the sine wave (s) to the two channels and read the values of V, if they read the same value, the difference should always be zero but I get-0,002 to 0.002 Volt difference (I must find a way to convert it in time). A screenshot of my VI is attached. I wonder how I can accurately measure the time delay between the channel.

    I am open to any suggestion, my final goal to read exactly two channels at the same time ((ou connaître le délai exact donc je peux correspondre les données correspondantes étant donné le temps de retard))

    Hi spinup,

    better you should post your question in the forum of LabVIEW, LabWindows/CVI is used

    Good luck.

  • How to find the hours between two times

    Hai All

    I had a problem I need to calculate work time

    For example

    Respondent outtime

    0815 1715

    So I need to calculate a time between these two times

    How can I do using function for 100 our

    Concerning

    Srikkanth.M

    Hello

    use the below the update statement.

    update dail_att set wtime =  extract(hour from (to_date(outtime,'HH24:MI')-to_date(intime,'HH24MI')) day to second);
    

    Solution of the sample...

    PRAZY@11gR1> desc dte;
     Name            Null?    Type
     ------------------- -------- --------
     INTIME           VARCHAR2(4)
     OUTTIME        VARCHAR2(4)
     HRS                NUMBER
    
    PRAZY@11gR1> select * from dte;
    
    INTIME     OUTTIME           HRS
    ---------- ---------- ----------
    0815       1715
    0900       1800
    0830       1630
    
    Elapsed: 00:00:00.00
    PRAZY@11gR1> update dte set hrs = extract(hour from(to_date(outtime,'HH24MI')-to_date(intime,'HH24MI')) day to second);
    
    3 rows updated.
    
    Elapsed: 00:00:00.01
    PRAZY@11gR1> select * from dte;
    
    INTIME     OUTTIME           HRS
    ---------- ---------- ----------
    0815       1715                9
    0900       1800                9
    0830       1630                8
    
    Elapsed: 00:00:00.00
    

    Kind regards
    Prazy

    Published by: Prazy on March 24, 2010 12:43

  • How can I enter the "/" between two numbers without it dividing two numbers?

    I'm creating a form of estimate of our printing. In printing, a flyer side 2 color is referred to as "4/4". A color face a flyer is "4/0. I have a drop down menu that is using these options and then I use Index) Match for search costs associated with printing a brochure side 2 color (4/4). The slightest mistake of formula is to say that it does not find "4/4", and I think that its because it retains "4/4" because '1'. "." I tried the following:

    Change the format of text data

    Change the format of date/time data

    Editing the cell to = "4/4".

    The strange thing is it works sometimes - and then all of a sudden it no longer works. I'm willing to change it to "4\4" or "4 on 4" if I have too, but its amazing to me that there is no way to force numbers to display both the drop-down menu and the table cell to simply see "" 4/4 in the text and is not a division problem. ""»

    Any thoughts or ideas?

    Thank you.

    I think that building is something like this:

    = number + text("/") + number

    Sorry, but I don't use Pages, but you will probably discover what the operation is for the "text()".

  • How to calculate the difference between two numbers in text fields

    Hello, I am fairly new to this, and I am certain that I will be bothered by the simple answer is

    I do a simple calculation... total of total assets - liabilities = net worth

    I have my total assets and my total work of the liability, but is not a subtraction option in the properties of a text field for the Net of a field value.

    I don't know... not any script Java can any who help out me?

    Thank you

    Judy

    You can use the option of simplified field notation, but first your input fields names must be changed so that they do not contain spaces or punctuation. For example:

    TotalAssets - TotalLiabilities

    If you want to use JavaScript, what will be needed if you ever in more complicated calculations, you can use something like the following as the custom fields (net value) calculation script:

    (function () {}

    Get the values of the field as numbers

    var v1 = + getField("total_assets").value;

    var v2 = + getField("total_liabilities").value;

    calculate the value of this field

    Event.Value = v1 - v2;

    })();

    There are no restrictions on domain names when using JavaScript.

  • How to increment a number between two unique number fields for columns?

    Heya

    I got this table structure

    name | ID

    one | 1
    b | 2
    d | 3

    the number column cannot contain duplicate values, so when I want to insert a field 'c' with the id of "3" via a form

    I use this method:

    -------------------


    < cfif IsDefined "(FORM. MM_InsertRecord") AND the FORM. MM_InsertRecord EQ 'form1' >

    < cfquery datasource = 'my_db' >

    UPDATE CATEGORIES
    SET category_order_mnu = category_order_mnu + 1
    WHERE category_order_mnu > #FORM.category_order_mnu #;

    INSERT INTO CATEGORIES (category_name, category_order_mnu)
    VALUES)
    < cfif IsDefined ("FORM.category_name") AND #FORM.category_name # NEQ "" > "".
    "#FORM.category_name #".
    < cfelse >
    NULL VALUE
    < / cfif >
    ,
    < cfif IsDefined ("FORM.category_order_mnu") AND #FORM.category_order_mnu # NEQ "" > "".
    #FORM.category_order_mnu #+1
    < cfelse >
    NULL VALUE
    < / cfif >
    )
    < / cfquery >
    < / cfif >

    ------------


    The problem is that I get this error message:
    Quote:

    "" Characters found after end of SQL Plus? »

    The error occurred in C:\CFusionMX7\wwwroot\aiav1\aiacp\categories\addcategory.cfm: line 40

    38: < cfelse >
    39: NULL
    40: < / cfif >
    41 :)
    42: < / cfquery >

    CATEGORIES of UPDATE SQL SET category_order_mnu is category_order_mnu + 1 WHERE category_order_mnu > 3;. INSERT INTO CATEGORIES (category_name, category_parent_id, category_visible, category_tooltip, category_order_mnu) VALUES ('Programme', 0, NULL, 3 + 1)
    DATASOURCE my_db
    VENDORERRORCODE 3092
  • A torn my sticker with the serial number. How to find the number of the whole installation?

    Best regards, tore my sticker with the serial number. I don't see the numbers. How to find the number of the whole installation?

    Original title: windows 7 sn

    Option 1:

    If the COA sticker is damaged, you must use the recovery partition to reinstall Windows 7, it will be exempt from the need to use the product key to activate your installation of Windows 7.

    Option 2:

    If your recovery partition is not available or damaged, you must contact the manufacturer of your computer, and request that a defined recovery disk you can use to reinstall Windows 7. They could practice a small shipping and handling. This will exempt the need to also use the product key.

    Option 3:

    If neither options 1 or 2 is possible, then you will need to invest in a new license of full version of detail.

  • How to find the relationship between the tables

    Hello
    I am working in Oracle R12

    How to find the relationship between these tables INV_MIN_MAX_TEMP, po_requisition_lines_all and Per_all_people_f

    These two tables, I joined with po_requisition_lines_all and Per_all_people_f To_person_id of PO and anyone HR table but I can't able to join this table with other tables INV_MIN_MAX_TEMP

    concerning
    Srikkanth

    solved

  • Find the difference between two date and time

    Hi friends,

    I wanted to find the difference between two date and time, but my qury is slightest error "invalid number."

    select sql_step_num,proc_name,run_seqno,start_date,end_date,(to_char(start_date,'HH24-MI-SS') - to_char(end_date,'HH24-MI-SS') ) as ed  
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate) 
    order by sql_step_num;

    You try to get the feel between two char strings.
    And more difference between two dates gives a NUMBER of days.
    Try this:

    select sql_step_num,proc_name,run_seqno,start_date,end_date,numtodsinterval(end_date-start_date,'DAY') as ed
    from eval.EVAL_RUNTIME_DETAILS
    where trunc(start_date) = trunc(sysdate)
    order by sql_step_num;
    
  • How to find the number of data items in a file written with the ArryToFile function?

    I wrote a table of number in 2 groups of columns in a file using LabWindows/CVI ArrayToFile... Now, if I want to read the file with the FileToArray function so how do I know the number of items in the file. during the time of writing, I know how many elements array to write. But assume that I want the file to be read at a later time, then how to find the number of items in the file, so that I can read the exact number and present it. Thank you all

    Hello

    I start with the second question:

    bytes_read = ReadLine (file_handle, line_buffer, maximum_bytes);

    the second argument is the buffer to store the characters read, so it's an array of characters; It must be large enough to hold maximum_bytes the value NULL, if char [maximum_butes + 1]

    So, obviously the number of lines in your text tiles can be determined in a loop:

    Open the file

    lines = 0;

    While (ReadLine () > 0)

    {

    lines ++;

    }

    Close the file

  • How to find the difference between standard edition and standard edition one

    How to find the difference between oracle database standard edition and standard edition one 64 bit

    (a) using sql
    (b) using the configuration/installation files

    How to find the difference between oracle database standard edition and standard edition one 64 bit

    (a) using sql

    Select * the option of $ v;

    (b) using the configuration/installation files

    opatch lsinventory-details

  • How to find the number of users connected to the database of the level operating system (Linux)

    Hi all

    Could someone knows how to find the number of users connected to the database without connection with sql * more

    y at - it a command to find?

    example, we have 10 databases in a server, how to find the number of users connected to the special data base without connecting to database(v$session)?

    the Oracle version:-10g, 11g
    Operating system:-OEL4, OEL5, AIX, Solaris

    any help will be appreciated.

    Thanks in advance.

    Thank you.

    Kind regards
    Rajesh.

    but you can say total number of connection with the above given the command? It would also be useful to know.

    See you soon,.
    LKM

Maybe you are looking for

  • Problem running Windows 7 Ultimate on Toshiba NB 500

    I have a Toshiba NB 500 brand new, bought with Windows7 Starter. I've upgraded to Windows 7 Ultimate and performance are terrible. The processor works 80-100% beyond 1 GB of RAM are used only by the system and all the programs I try to start takes fo

  • PDF no longer works

    Name of product: notebook PC HP ENVY 17 of TS Product number: C8U17AV 8.1 Windows 64-bit Seems that every week there is a new problem with this laptop, the worst I have ever owned. When I click on a PDF file to open it, the orange logo PDF screen app

  • Should I turn off the keyboard and mouse after use or leave?

    I find it annoying to switch the keyboard power continually because of the password on and off.   Wouldn't be much difference to the life of the battery to let both mouse and keyboard lights permanently?

  • Scanner and Camera Wizard no longer works

    The automatic transfer to "Scanner and Camera Wizard" function has stopped working on one of my two digital cameras.

  • Driver Audio HP 15 - r033tx DTS problem control panel

    I installed win7 64 bit sp1 operating system on my hp r033tx laptop. But the DTS audio Panel is not showing even I downloaded the driver software on the official site of HP for windows7 64 bit os.please help me. I bought on 6 October 2014.