CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 3332|Reply: 4

c language

[Copy link]
Post time 23-12-2010 12:32 PM | Show all posts |Read mode
minta tolong kawan2 yang teror c language.

macam mana nak move value duit dari table ke temp variable ???
variable tu nak kena declare apa???
contoh :

            kat DB value tu amount = 100000000.15

kat program saya declare TempValue sebagai long int.
long int TempValue

       bila saya move dari amount ke TempValue dia hanya ambil 100000000 ... yang 15 sen tu cicir..

kalau saya declare TempValue sebagai float
float TempValue

    bila saya move amount ke TempValue dia bagi nombor merapu

syntax macam mana dan declaration yang macamana perlu saya buat supaya value yang
kita move dapat sebiji macam value amount kat db tu????
Reply

Use magic Report


ADVERTISEMENT


Post time 1-1-2011 01:35 PM | Show all posts
tertinggal 'f' kot... 100000000.15f
Reply

Use magic Report

Post time 18-1-2011 03:46 AM | Show all posts
c aku x tau.
kalo c++ leh la aku tlng..
Reply

Use magic Report

Post time 7-3-2011 05:05 PM | Show all posts
Post Last Edit by acesecure at 7-3-2011 17:23

float Tempvalue;
Tempvalue = 100000000.15;{
printf("%20f\n", "Temp value", TempValue);
}
ko wat camnie ke???? try guna long float atau double
Reply

Use magic Report

Post time 1-4-2011 08:11 PM | Show all posts
long int -> amik integer di depan titik perpuluhan sahaja
cuba guna long double ..
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

23-12-2024 08:37 PM GMT+8 , Processed in 0.700473 second(s), 17 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list