* *
*
* * News
 • Daily news
 • Archived news

Columns
 • WildCard
 • Qbasic Articles
 • QB Comic!

Learning center
 • QB Books
 • Qbasic Lessons!
 • Qbasic FAQ
 • Newbies Section
 • Qbasic Tutorials

* *
*
*
*
*  
.INT Function Programming Example.

  QuickSCREEN      Details     Example      Contents      Index
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
INT Function Programming Example
This example compares output from INT, CINT, and FIX, the three
functions that convert numeric data to integers.
 
CLS                ' Clear screen
PRINT "  N","INT(N)","CINT(N)","FIX(N)" : PRINT
FOR I% = 1 TO 6
    READ N
    PRINT N, INT(N), CINT(N), FIX(N)
NEXT
DATA  99.3, 99.5, 99.7, -99.3, -99.5, -99.7
 
 
Sample Output
 
  N           INT(N)        CINT(N)       FIX(N)
 
99.3          99            99            99
99.5          99            100           99
99.7          99            100           99
-99.3         -100          -99           -99
-99.5         -100          -100          -99
-99.7         -100          -100          -99
 
* * ** * * * *