When would you use int, char? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

When would you use int, char?

6th May 2018, 5:50 PM
Miguel Guerrero
Miguel Guerrero - avatar
6 Answers
+ 9
Use the INT function when you want only the integer part of a decimal number, and it's ok to always round the number down. For example, INT (3.99) returns the number 3. It's important to note that INT actually rounds down numbers to the next lowest integer value. Char. The abbreviation char is used as a reserved keyword in a number of programming languages, such as C, C++, C#, and Java. It is short for character, which is a data type that holds one character (letter, number, etc.) of data.
6th May 2018, 5:54 PM
Scooby
Scooby - avatar
+ 5
no problem ^^
6th May 2018, 7:33 PM
Scooby
Scooby - avatar
+ 2
ok awesome thanks, but in the lesson they use var. when would you use var instead int for a number?
6th May 2018, 6:12 PM
Miguel Guerrero
Miguel Guerrero - avatar
+ 2
thank you
6th May 2018, 7:33 PM
Miguel Guerrero
Miguel Guerrero - avatar
0
var is used to define a variable. int, char are the data types of a variable
7th May 2018, 5:53 AM
Janu Kumar
Janu Kumar - avatar