FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The program that Mauricio is creating to track his allowance, must store and access variables in the form of dollars and cents. Which variable data type should he use to store numbers that contain a decimal?
A
Floating point
B
Boolean
C
String
D
Integer
Explanation: 

Detailed explanation-1: -1. Integer Data Type. An integer type variable can store zero, positive, and negative values without any decimal. In C language, the integer data type is represented by the ‘int’ keyword, and it can be both signed or unsigned.

Detailed explanation-2: -Answer. Explanation: Numbers that contain a decimal point are stored in a data type called REAL. Variables that use the real data type can accept both positive and negative numbers with a decimal place.

Detailed explanation-3: -Integers are whole numbers. They can be positive, negative, or zero. Numbers like-321, 497, 19345, and-976812 are all perfectly valid integers, but 4.5 is not because 4.5 is not a whole number. Floating point numbers are numbers with a decimal.

Detailed explanation-4: -Floating-Point Data Type Floating-point data types are used to define variables that can hold real numbers.

There is 1 question to complete.