Untitled Document
Untitled Document
● Cannot be a keyword
● No special characters or spaces
● Case-sensitive
● \n – New Line
● \t – Tab
● \\ – Backslash
● \a – Alert (Beep)
● %d – Integer
● %f – Float
● %c – Character
● %s – String
● %lf – Double
9. Operator Precedence in C:
1.Parentheses ()
3.Multiplicative *, /, %
4.Additive +, -
● printf()
● scanf()
● strlen()
● sqrt()
c
CopyEdit
int a = 5;
printf("%p", &a);
c
CopyEdit
goto label;
// ...
label:
printf("Jumped here");
c
CopyEdit
if (x > 0)
printf("Positive");
else
printf("Negative");
● Modularity
● Simplifies debugging
● Saves memory
● Efficient searching/sorting
● Machine Language
● Assembly Language
● High-Level Language
● Functional (Haskell)
● Logic-based (Prolog)
mathematica
CopyEdit
Start
Input a, b
Sum = a + b
Print Sum
End
● Start/End – Oval
● Process – Rectangle
● Decision – Diamond
● Input/Output – Parallelogram
A command in a C program.
Example: x = x + 1;
● Single-line: // comment
● Sequence
● Library Functions
● User-Defined Functions
● Recursive Functions
● Reusability
● Modularity
● Easy debugging
● Improved readability
● Code reduction