Programming For Problem Solving Notes Pdf Guide
| Type | Size (approx) | Format Specifier | |------|--------------|------------------| | int | 2/4 bytes | %d | | float| 4 bytes | %f | | char | 1 byte | %c | | double| 8 bytes | %lf |
for loop: for(init; condition; update) while loop: while(condition) do-while loop: do while(condition); → executes at least once. programming for problem solving notes pdf
Source code (.c) → Preprocessor → Compiler → Object code → Linker → Executable (.exe) | Type | Size (approx) | Format Specifier
if (condition) // code; else if (cond2) // code; else // code; () → ++ -- → * / %
char str[] = "Hello"; // null terminated: 'H','e','l','l','o','\0' strlen() , strcpy() , strcat() , strcmp() , strchr() 11. Structures & Unions Structure: groups different data types.
() → ++ -- → * / % → + - → < > <= >= → == != → && → || → = 5. Conditional Statements if-else:
return_type function_name(parameters) // body return value;
| Type | Size (approx) | Format Specifier | |------|--------------|------------------| | int | 2/4 bytes | %d | | float| 4 bytes | %f | | char | 1 byte | %c | | double| 8 bytes | %lf |
for loop: for(init; condition; update) while loop: while(condition) do-while loop: do while(condition); → executes at least once.
Source code (.c) → Preprocessor → Compiler → Object code → Linker → Executable (.exe)
if (condition) // code; else if (cond2) // code; else // code;
char str[] = "Hello"; // null terminated: 'H','e','l','l','o','\0' strlen() , strcpy() , strcat() , strcmp() , strchr() 11. Structures & Unions Structure: groups different data types.
() → ++ -- → * / % → + - → < > <= >= → == != → && → || → = 5. Conditional Statements if-else:
return_type function_name(parameters) // body return value;