






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to computer programming from a beginner's perspective. It covers the basics of computers, data, information, hardware, and software. The document also discusses the concept of programming, including the five-step process and the difference between system and application software. Additionally, it introduces the concept of flowcharts and structured flowcharts.
Typology: Exercises
1 / 11
This page cannot be seen from the preview
Don't miss anything!







STRING or LITERAL STRING
Greater than < Less than = Greater than or equal to <= Less than or equal to == Equal to ! = Not equal to
#include <stdio.h> = library file/a header file which has the necessary information to include the input/output related functions in our program. Example printf, scanf etc. .h = header file %p = use for memory address %d = integer %s = String %f = decimal numbers %c = single char %u = use for NULL / is an unsigned integer/can hold only positive value. %[^\ns] = para pwede may SPACE sa string char = single character char [number of characters] = multiple character pow = power or raised to sqrt = square root ceil = round up floor = round down /n = new line (escape sequence) /t = new tab & = pointer and it is NOT NEEDED FOR STRINGS (%lf) = use for scanf for double or decimal numbers (4 decimal places) / Note: walang space dapat ("%lf") (%f) = use for scanf and printf for double or decimal numbers ( decimal places) (%c)= use for scanf and print single character / Note : kelangan walang space ("%c") (%.1f) = field width / reduce decimal point into 1 fgets (variable) = store string of characters / verify how many characters we input /store line of text scanf = need value of characters [20] stdin = Standard input /* */ =Comments const = constant di nababago return = breaks out the function / return value back to the caller && = Called Logical AND operator. If both the operands are non-zero, then the condition becomes true. (A && B) is false. || = Called Logical OR Operator. If any of the two operands is non-zero, then the condition becomes true. (A || B) is true. ! = Called Logical NOT Operator / NEGATION OPERATOR kung ano yung mali yun yung piniprint kung ano yung tama yun yung hindi ipprint (baliktad/opposite). It is used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make it false. if(!(A && B)) is true. (3 != 2) is true else = di na nag check ng condition diretso na agad : if (a > b) printf(a) else printf(b) else if = nag ccheck ng condition : if (a > b) printf(a) else if (b >a ) printf(b) for loop = (initialization; condition;increment & decrement || upadate statement);
= decrement (j--) (--j) < = invrement (j++) (++j) index = h e l l oworld 0123 456789 ASCII table
+= (sum is equals to variable) (sum += c; ) switch statements = mas madaling basahin / allows us to execute one code block break = end of block case '+': default = parang else case = colon lang (:) printf("%.1lf + %.1lf = %.1lf",n1, n2, n1+n2); break; array = container of variables struct = pinagsasama sama yung mga data types kelangan may semi colon sa dulo / struct variable{ }; strcpy = The strcpy() function copies the string pointed by source (including the null character) to the destination./kinokopya yung isang data type na walang laman .EX KOKOPYAHIN NG STR2 YUNG LAMAN NG STR int main() { char str1[20] = "C programming"; char str2[20] = " "; puts() = command na nag pprint ng data na galing sa declaration. Ex. char Mystr[] = "The puts() functions"; puts(Mystr); boolean = True or False //case sensitive //SMALL LETTERS ONLY / 0 = false 1 = true '\0' = is referred to as NULL character or NULL terminator It is the character equivalent of integer 0(zero) as it refers to nothing // example sa words 0 nagsisimula yung pag bilang ng bawat letters. pointer (%p) =another type of data for memory address / print hexadecimal number voin main() - function // = comments in single line /* */ = comments as a group 15==15?100:200 = pag true ( or kaliwa) pag false (200 or kanan) = Ternary getch(); = hanggat walang na iinput user di papasok sa susunod na statement compound sentence = may curly braces {} single sentence = walang curly