Basic Input - Output. Output functions printf() – is a library function that displays information on-screen. The statement can display a simple text message.

Презентация:



Advertisements
Похожие презентации
Data Types in C. A Data Type A data type is –A set of values AND –A set of operations on those values A data type is used to –Identify the type of a variable.
Advertisements

Michael Marchenko. In mathematics, a sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements, or terms),
Using Bash Shell. Command Line Shortcuts File Globbing Globbing is wildcard expansion: * - matches zero or more characters ? - matches any single character.
1/27 Chapter 9: Template Functions And Template Classes.
Data Variable and Pointer Variable Pass by Reference Pointer Arithmetic Passing Array Using Pointers Dynamic Allocation.
7/23/ :59:16 AM Each slide transits to the next Automatically.Just WAIT!1 This cosine curve would now be represented as a consequence of a synchronized.
Operator Overloading Customised behaviour of operators Chapter: 08 Lecture: 26 & 27 Date:
Standard I/O and Pipes. Standard Input and Output Linux provides three I/O channels to Programs Standard input (STDIN) - keyboard by default Standard.
Basic Computer Terms. Instructions executed( исполнять, выполнять ) by a computer – software Applications- прикладная программа Complete, self-contained.
CEG 320/520: Computer Organization and Assembly Language Programming1 Computer Organization and Assembly Language Programming.
MEK-6400 series Technical seminar Sensors adjustment.
A DIALOGUE WITH A COMPUTER. Цель: познакомить учащихся с компьютерной терминологией на английском языке и стимулировать ее активное использование в речи.
1 Arrays and Strings Lecture: Design Problem l Consider a program to calculate class average Why?? ?
Loader Design Options Linkage Editors Dynamic Linking Bootstrap Loaders.
BUSINESS LETTER TRUE OR FALSE TEST. Are the following statements True or False? TRUE FALSE.
7/29/2015Image Processing 1 Image Processing Using Matlab*
Unit II Constructor Cont… Destructor Default constructor.
Overview of the Paysonnel CE. Overview Paysonnel CE Go to URL- 1 Click [Login to Paysonnel CE] 2 How to Log-in to Paysonnel CE 1 2.
Sequences Sequences are patterns. Each pattern or number in a sequence is called a term. The number at the start is called the first term. The term-to-term.
SPLAY TREE The basic idea of the splay tree is that every time a node is accessed, it is pushed to the root by a series of tree rotations. This series.
Транксрипт:

Basic Input - Output

Output functions printf() – is a library function that displays information on-screen. The statement can display a simple text message or a message and the value of one or more program variables printf() – is a library function that displays information on-screen. The statement can display a simple text message or a message and the value of one or more program variables gotoxy() – positions the cursor on a specific location on the screen gotoxy() – positions the cursor on a specific location on the screen clrscr() – clears the screen and place the cursor at the upper left hand portion of the screen clrscr() – clears the screen and place the cursor at the upper left hand portion of the screen

Input functions scanf() – reads data from the keyboard according to a specified format and assigns the input data to one or more program variables. For numeric variables, the address can be passed by the address of operator, the ampersand (&) that is placed at the beginning of the variable name. scanf() – reads data from the keyboard according to a specified format and assigns the input data to one or more program variables. For numeric variables, the address can be passed by the address of operator, the ampersand (&) that is placed at the beginning of the variable name. getch() / getche() – gets a character from the keyboard. It waits until a key is pressed and then returns the inputted character to the calling function. Unlike the scanf() function, getch/e() does not wait for the carriage return key to be pressed. getch() / getche() – gets a character from the keyboard. It waits until a key is pressed and then returns the inputted character to the calling function. Unlike the scanf() function, getch/e() does not wait for the carriage return key to be pressed. The difference between the getch() and getche() is that the latter echoes the typed character to the screen.

Escape Sequences \ \rcarriage return \nnewline \tmove to the next tab \abeep the speaker \bbackspace prints single quote \prints double quote \\prints backslash character \xddprints character whish is in hexadecimal form

Format Specifier % %ccharacter %sstring %dinteger %ffloat %eexponential %xhexadecimal %ooctal %ldlong integer %lflong float / double precision

Declaration of Variables A variable is a named data storage location in your computers memory. Variables in C can contain letters, digits and the underscore character ( _ ). It should be remembered that C language is case sensitive; two similar words in different cases generate two different variables. A variable declaration tells the compiler the name and type of a variable and optionally initializes the variable to a specific value. When a variable is declared, the compiler sets aside a storage space for the variable.

Variable Type Keyword Bytes Required Range Characterchar to 127 Integerint to Long integer iong int to Floatfloat4 1.2E-38 to 3.4E38 Double precision double8 2.2E-308 to 1.8E308