Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
Algorithms and Programs 67
The C programming languages provide several functions for console in-
put/output. The function for input reads the value of a variable from the input device.
The name of the function is scanf, and is used with a format operator. The general
form for input in C for reading the value of a numeric floating-point variable, var, is
shown in the following line of code.
scanf (" %lf", &var);
A string message is typically included to prompt the user for input of a data value.
This is implemented with the printf function. The previous example for reading the
value of variable y is written in C as follows:
printf ("Enter value of y:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783