EasyManua.ls Logo

Casio FX-890P User Manual

Casio FX-890P
126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #88 background imageLoading...
Page #88 background image
88
The following results would be displayed:
.R U N . .
>run
D=65 O=101 H=41 C=A
>_
6.2.2 Variable types and operations
Declaring variable types
With C programs, you have to declare the type of data that will be assigned to each
variable before you can use the variable. The following statement, for example, tells
the computer that the variable “x” will be used for the storage of integers:
int x;
The following table shows the other declarations that can be made for variables.
Declaration
Meaning
char
short
int
long
float
double
8-bit integer
16-bit integer
16-bit integer*
32-bit integer
32-bit single precision floating point
64-bit double precision floating point
Besides these, you can also include the declaration “unsigned” in front of any of the
integer declaration (except long) to indicate that the integer is unsigned (no
positive/negative sign)
*Note: the “int” declaration is hardware dependent, despite the fact it is the default
type in many cases, and the fastest for arithmetics. On the pocket computer, which
uses a 16-bit microprocessor, it refers to a 16-bit integer. But on other processors, it
may refer to 24-bit or 32-bit integers. For best portability, it is recommended to use
the “short” declaration instead, when possible.
Assigning values to variables
To see how to declare variables and also how to assign values, let’s write a program
that performs various operations using the values 49 and 12.
Enter the editor and input the following program.
/* Arithmetic Operations 1 */
main(){
short a,b,c,d,e;
a=49+12;printf(“%d “,a);
b=49-12;printf(“%d “,b);
c=49*12;printf(“%d “,c);
d=49/12;printf(“%d “,d);
e=49%12;printf(“%d¥n“,e);

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Casio FX-890P and is the answer not in the manual?

Casio FX-890P Specifications

General IconGeneral
BrandCasio
ModelFX-890P
CategoryDesktop
LanguageEnglish

Summary

Unit Configuration

Operational Functions

Details the primary keys and their functions, including power, shift, and numeric keys.

Keyboard Layout

Describes the arrangement of keys and how to access different functions.

Power and System Features

Power Supply and Battery Replacement

Provides instructions for replacing the calculator's batteries.

Fundamental Operation Modes

CAL Mode

Describes the primary calculation mode active upon power-on.

Formula Storage Function

Explains how to store and recall mathematical formulas for repeated calculations.

Programming Modes

Introduces BASIC, C, CASL, and Assembler modes for programming.

Calculation Functions

Manual Calculation Input and Correction

Guides on entering and correcting arithmetic and function calculations.

BASIC Programming

Features of BASIC

Highlights the advantages and capabilities of the BASIC language.

BASIC Program Input

Provides steps for entering and preparing BASIC programs.

BASIC Program Execution

Details how to run BASIC programs and handle execution errors.

BASIC Variables and Commands

Variables

Explains numeric, string, and array variables in BASIC.

BASIC Command Reference

A comprehensive reference for BASIC commands and functions.

BASIC Command Reference Details

Mathematical Functions

Reference for ABS, ACS, ANGLE, COS, SIN, SQR, TAN, etc.

BASIC String and Graphical Functions

C Programming Introduction

Learning C with Pocket Computer

Guidance on using the pocket computer as a C learning tool.

Meet the Casio C Interpreter

Introduces the C interpreter and its operation compared to compilers.

C Program Input Procedures

Using the C Editor

Details on creating and editing C source code.

C Program Execution

C Programming Essentials

Variable Types and Operations

Covers C data types (char, int, float, double) and assignments.

Selection Statements

Explains the 'if' and 'if-else' statements for conditional logic.

C Control Flow and Functions

Using Loops

Details 'while', 'do-while', and 'for' loops for repetitive execution.

Defining Functions

Explains how to create and use custom functions in C.

C Constants, Variables, and Operators

Constants and Variables

Covers variable scope, types, and storage.

C Operators and Command Reference

Operators

Lists and explains C operators and their precedence.

C Command Reference

Reference for C commands like RUN, EDIT, TRON, TROFF.

C Command Reference Details

String Functions

Reference for strcat, strchr, strcmp, strcpy, strlen.

Related product manuals