Programming For Problem Solving Notes Pdf May 2026
if (condition) // code; else if (cond2) // code; else // code;
Source code (.c) → Preprocessor → Compiler → Object code → Linker → Executable (.exe)
| Type | Size (approx) | Format Specifier | |------|--------------|------------------| | int | 2/4 bytes | %d | | float| 4 bytes | %f | | char | 1 byte | %c | | double| 8 bytes | %lf | programming for problem solving notes pdf
char str[] = "Hello"; // null terminated: 'H','e','l','l','o','\0' strlen() , strcpy() , strcat() , strcmp() , strchr() 11. Structures & Unions Structure: groups different data types.
struct Student int roll; char name[20]; float marks; ; struct Student s1 = 1, "John", 85.5; same memory shared among members (size = largest member). 12. File Handling Basic operations: Open, Read, Write, Close. if (condition) // code; else if (cond2) //
for loop: for(init; condition; update) while loop: while(condition) do-while loop: do while(condition); → executes at least once.
int arr[5] = 1,2,3,4,5; arr[0] = 10; // index 0-based int arr[5] = 1,2,3,4,5; arr[0] = 10; //
() → ++ -- → * / % → + - → < > <= >= → == != → && → || → = 5. Conditional Statements if-else: