Programming For Problem Solving Notes Pdf [RECOMMENDED]
for loop: for(init; condition; update) while loop: while(condition) do-while loop: do while(condition); → executes at least once.
return_type function_name(parameters) // body return value; programming for problem solving notes pdf
switch(expression) case 1: ... break; case 2: ... break; default: ... break; break; default:
() → ++ -- → * / % → + - → < > <= >= → == != → && → || → = 5. Conditional Statements if-else: (NOT) Assignment: =, +=, -=, etc
scanf("%d", &x); // read printf("Value: %d", x); // print Arithmetic: +, -, *, /, % Relational: ==, !=, <, >, <=, >= Logical: && (AND), || (OR), ! (NOT) Assignment: =, +=, -=, etc. Increment/Decrement: ++, -- (prefix/postfix)
char str[] = "Hello"; // null terminated: 'H','e','l','l','o','\0' strlen() , strcpy() , strcat() , strcmp() , strchr() 11. Structures & Unions Structure: groups different data types.
break (exit loop/switch), continue (skip iteration), goto (jump to label – avoid when possible). 7. Arrays One-dimensional: