Академический Документы
Профессиональный Документы
Культура Документы
Basic Syntax
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Overview
Semicolon
Variable Declarations
Code Blocks
Functions
Comments
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Semicolon ;
Terminator
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
<Variable Type> <Variable Name> = <Expression>;
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
Variable Type
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
Variable Name
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
Expression (Value)
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
Terminator
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
int num;
num = 10;
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to declare a variable in C
int num;
num = 10;
Variable declaration
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to stack variable declarations
int x = 10;int y = 1 + 2;
Terminator
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
How to stack variable declarations
int x = 10;int y = 1 + 2;
Same as
int x = 10, y = 1 + 2;
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Variable Declaration
Whitespace is ignored by the compiler
int y = 1 + 2;
int y=1+2;
Same expression
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Code Blocks
Sections code that belongs to a particular structure
{
<CODE>
}
End Code Block
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Code Blocks
Sections code that belongs to a particular structure
int main()
{
if (x == y)
{
}
return 0;
}
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Function Declaration
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Programming in C
Function Declaration
How to declare a function
Parameter
Separator ,
Programming in C
Function Declaration
How to declare a function
Next parameter
Programming in C
Calling a Function
<Function Name> (<Parameters>);
Power(2, 3);
or
int x = Power(2, 3);
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Calling a Function
<Function Name> (<Parameters>);
Power(2, 3);
or
int x = Power(2, 3);
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Calling a Function
<Function Name> (<Parameters>);
Power(2, 3);
or
int x = Power(2, 3);
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Writing a Comment
int x = Power(2, 3);
//Comment a single line with two slashes
//Print the statement below
printf(The result is %d\n, x);
//Reset the variable x to 0.
x = 0;
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Writing a Comment
int x = Power(2, 3);
/*
Block comments can span multiple lines
Next we will print the statement below
*/
printf(The result is %d\n, x);
x = 0; //Reset the variable x to 0.
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net
Programming in C
Programming in C
The End
Thanks for watching!
Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net