You are on page 1of 9

/BASIC OF

PROGRAMM
ING

Copyright
©austinmakasare22@gmail.com
</TABLE OF CONTENTS>

/O1 VARIABLES/02 DATA TYPES

/04 /03
KEYWORDS OPERATORS

Copyright
©austinmakasare22@gmail.com
</VARIABLES>
Variable is the name of a memory
RULE
location where some data is
stored
S Variables
1. are case sensitive

Int b = 22; 2. 1st character is alphabet or ‘_’

3. no comma/blank space

MEMO 4. No other symbol other than ‘_’


RY
a b
ad 22
d

Copyright
©austinmakasare22@gmail.com
</basics chart>

TYPE MEANING MODIFIE


R
Character Character data char
Integer Signed whole numbers int
Float Floating point numbers float
Double Double precision floating point double
numbers
Signed Positive and negative numbers signed
Long Double the length of a number long
Short Halves the length of a number short

Copyright
©austinmakasare22@gmail.com
</DATA TYPES>
CONSTAN
DATA TYPES SIZE IN BYTES
TS
Values that don’t
Char or signed char 1
change(fixed)
Int or signed int 2
Short int 2 Types
Long int 4
Float 4
Double 8 Integer Character
constants constants
Long double 10 Real
1,2,3,0, constants ‘a’ , ’b’ , ’A’,
-1,-2,-3 ‘#’ , ‘&’
1.0,2.0,
3.14,-22

Copyright
©austinmakasare22@gmail.com
</KEYWORDS>
Reserved words that have
special meaning to the
compiler
auto double int struct
32 keywords in C break else long switch
case enum register typedef
Compilation
char extern return union
A computer program that translates
C code into machine code continue for signed void
do if static while
default goto sizeof volatile
const float short unsigned
Hello.c C Compiler a.exe (windows)
a.out (linux & mac)

Copyright
©austinmakasare22@gmail.com
</OPERATORS>
Operation Type Operator’s Type Operators

Unary Increment, Decrement Operators ++, --


Operators
Arithmatic Operators +,-,*,/,%

Logical Operators &&, ||, !

Binary Operators Relational Operators <, <=, >, >=, ==, !=

Bit_wise Operators &, |, <<, >>, ~, ^

Assignment Operators =, +=, -=, *=, /=,


%=
Terinary Operator Ternary or Conditional Operator ?:

Copyright
Program Structure - To compile a program use command

#include<stdio.h> gcc hello.c


int main()
- To run a program use command
{
printf("Hello World"); ./a.out or ./a.exe
return 0;
}

Copyright
©austinmakasare22@gmail.com
- Variables & Data Types + Constants &
Keywords
#include<stdio.h>

int main()
Variable_name
{
datatype int number;
int age = 20;
int price; value

keyword return 0;
}
Constant

You might also like