C Language Tutorials by Ghulam Murtaza Dahar - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Constant qualifiers

Constant qualifiers can be declared with keyword const. An object declared by const cannot be modified.

const int p=20;

The value of p cannot be changed in the program.

Volatile qualifiers:

A variable should be declared volatile whenever its value can be changed by some external sources outside program. Keyword volatile is used to indicate volatile variable.

C Programming Input Output (I/O)

ANSI standard has defined many library functions for input and output in C language. Functions printf() and scanf() are the most commonly used to display out and take input respectively. Let us consider an example:

#include <stdio.h> //This is needed to run printf() function.

int main()

{

printf("C Programming"); //displays the content inside quotation

return 0;

}