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 #94 background imageLoading...
Page #94 background image
94
6.2.5 Using loops
Using the “while” loop
The “while” loop makes it possible to repeat execution of statements until a specific
condition is met. The format of the “while” loop is as follows:
while (condition)
Statement
The “while” loop first executes the condition. If the condition is met (true, returning a
value other than 0), the statement is executed, and execution loops back to the
“while” loop to evaluate the condition again. Whenever the condition is not met (false,
returning 0), execution of the “while” loop is ended.
You can have multiple statements in a while loop, but note the following format that
you should use in order to make the program easier to read:
while (condition){
Statement 1
Statement 2
.
.
Statement n
}
The closed brace should be directly under the “w” of the “while”. Keep the statements
indented.
Now, let’s create a program that uses the “while” loop. The program will output the
character codes for the characters “0” through “Z” as illustrated below:
Char(0) = Hex(0x30)
Char(1) = Hex(0x31)
Char(Z) = Hex(0x5A)
The following shows the program that produces such result.
/* Character codes */
/* #include <stdio.h> */
#define STR ‘0’
#define END ‘Z’
main(){
char ch;
ch=STR;
while (ch<=END){
printf(“Char(%c) = Hex(0x%x)¥n“,ch,ch);
getchar(); /* waits for return key */
ch++;
}
}

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