473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

What is the default type(int, float, char,....) of output of simple expression in "co

i just type "cout<<10/3;" and the output is "3", my question is why this is not "3.333.." !!????
is the default type is "integer"?????
Oct 21 '13 #1
1 1142
weaknessforcats
9,208 Expert Mod 8TB
10 is an integer. 3 is an integer. 10/3 is 3 because there are three 3's in 10.

Integers have no decimal portion.

Now if you do 10.0/3.0 then you have doubles and the result is 3.3333 as you expect.
Oct 21 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
9
by: Dr. Paul Bremmer, PhD | last post by:
Dear Access experts: Access is returning the error, "Expression too complex," despite only entering an absurdly simple math function. Is there a way to simplify this any further, or perhaps...
6
by: academic | last post by:
I want to compile a simple c program. Not c++ Not even Windows. Just a simple program to run in a DOS window. In vs2005 what type of project to I use. I can't get started. I tried a couple...
12
by: Robert.Holic | last post by:
Hi All (first time caller, long time listener), I've stumbled across a problem that I have yet to figure out, although Im sure I'll kick myself when I figure it out. Here it is: I need to...
4
by: tshad | last post by:
I can't seem to find anywhere how to set a null value (default) to a char variable. I know you typically set a char as: Dim temp as Char = "a" But how do you set it to binary 0 (null). ...
3
by: Car | last post by:
what dose this float value mean$B!)(B The value is: -1.#IND0
2
by: jeyshree | last post by:
please explain me the size of int ,float.,char,double,and pointers in 16 and 32 bit
30
by: Stephen Davies | last post by:
Hi, I'm making a quick database and need to use an expression. I have no idea what I'm doing. I would like the user to be able to input a number in one field, have Access perform a simple...
5
by: akdenizk | last post by:
Hello there, I'm reading lines from a text file in C++ which contains integer + string + float number(like 3,67 with comma) + string in this order. I need the float number to sort the lines but I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.