Basic Syntax of C Flashcards
Ignored by the C compiler
Comment
Used to document programs
Comment
Improve readability
Comment
Syntax for one-line comment
Syntax for multi-line comments
// /*...*/
Lines beginning with # are processed by the
preprocessor before compilation
Preprocessor Directive tells the preprocessor to include
<stdio.h>
What does the <stdio.h>
stand for?
Name of the standard library declaration file for all STandard Input and Output functions
Where does every C programs begins execute?
Function main
What function must contain in a C program?
main
What does void mean?
function main does not receive any information
What the function main will perform
Program Statements
Syntax of Program Statements
enclosing a block of program statements of the function within {}
How can statements terminate
Statements are terminated with a semicolon ;
What does the program statement do?
Instructs the computer to perform an action.
Syntax for variable declaration
data type variable_list;
All variables must be declared with _ before they can be used
name and data type
% indicates that
a variable’s value is to be printed, followed by a character representing it’s data type
What to use when printing a statement?
printf
What to use when scanning user input?
scanf
What is f in scanf?
formatted
Used to obtain a value from the user
scanf
Syntax of scanf
scanf(“%format control string”, &address operator)
Symbolic names is also known as
Variable Names
assign symbolic names, known as
variable names, for storing program computations and results
Variables