I am trying to find out the sum of marks in a program.i have taken marks as double and sum as int. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am trying to find out the sum of marks in a program.i have taken marks as double and sum as int.

tell me how can i convert double to int.so that i csn get the sum of marks.

27th Jan 2017, 8:34 AM
Pooja Upadhyay
Pooja Upadhyay - avatar
1 Answer
+ 1
Type casting: double d; int i; i = (int) d;
27th Jan 2017, 8:58 AM
Антон Обожин
Антон Обожин - avatar