Programming For Problem Solving Notes Pdf -
// variable declarations // statements return 0;
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. programming for problem solving notes pdf
return_type function_name(parameters) // body return value;
for loop: for(init; condition; update) while loop: while(condition) do-while loop: do while(condition); → executes at least once. // variable declarations // statements return 0; if
break (exit loop/switch), continue (skip iteration), goto (jump to label – avoid when possible). 7. Arrays One-dimensional:
| Type | Size (approx) | Format Specifier | |------|--------------|------------------| | int | 2/4 bytes | %d | | float| 4 bytes | %f | | char | 1 byte | %c | | double| 8 bytes | %lf | break (exit loop/switch)
Source code (.c) → Preprocessor → Compiler → Object code → Linker → Executable (.exe)