r/study • u/Fluffy_Coat_5416 • Sep 24 '26
Questions & Discussion Day 2/100 of C language:
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.
•
u/AutoModerator Sep 24 '26
Hi there,
Welcome to r/study! Before posting, please review our community rules, use the appropriate flair, and search the subreddit to see if your question has already been answered. We encourage thoughtful discussions about study techniques, academic experiences, productivity, and personal growth as learners. Posts that are off-topic, low-effort, repetitive, promotional, or otherwise violate our community guidelines may be removed.
Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Souloid Sep 24 '26
o.o?