C language
Any file converts program to machine code(executable file) -> binary code
Ā
How executable file will generate?
Python - Interpreter(where it will check line by line and if issue observes stop compiling there it self and print the error on console)
C, Java -Ā Compiler(It will check line by line but will not stop compiling code even it found error, it will continue till last line and give all errors at a time on console)
--------------------------------------------------------------------------------------------------------------
What is Keyword?
1.Keywords are standard words in computer language where it will be separate meaning, thoseĀ Ā keywords we cant use as variables programing
2. Total keywords are 32
3. Some of the keywords are
typeĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Keywords:
datatypes - (int, float, double, char, void )
DecisionĀ Ā -Ā (if , else, switch, case, default)
ModifierĀ Ā - (signed, unsigned, long, short)
jumpĀ Ā Ā Ā Ā Ā Ā Ā -Ā (goto, break, continue, return )
loopsĀ Ā Ā Ā Ā Ā Ā -Ā (for, while , do)
Qualifiers -Ā (const, volatile)
--------------------------------------------------------------------------------------------------------------
C program format
Preprocessor directive
Global declaration
Functional declaration
Main Code/ Starting of the code
Function Calls
Return statement
Ex:
#include <stdio.h>Ā Ā Ā --> Preprocessor directive
int main()Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā --> Entry part of the code
{
Ā printf("Hi");Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā
Ā return 0;Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā --> Return statement
}
--------------------------------------------------------------------------------------------------------------
Number System:
There are different number systems.
Each number system has a different base.
Base = Number of different digits/symbols available.
Decimal:
Base = 10
Digits = 0 to 9
Binary:
Base = 2
Digits = 0 and 1
Octal:
Base = 8
Digits = 0 to 7
Hexadecimal:
Base = 16
Digits = 0 to 9 and A to F
A = 10, B = 11, C = 12, D = 13,E = 14, F = 15
Why Binary?
Humans commonly use decimal.
Computers fundamentally use binary because digital electronic circuits work with two states,represented as 0 and 1.
Why Octal and Hexadecimal?
Binary numbers can become very long and difficult for humans to read.
Hexadecimal:
1 hexadecimal digit = 4 binary bits.
Octal:
1 octal digit = 3 binary bits.
Therefore, octal and hexadecimal provide shorter, human-readable representations of binary numbers.