<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=C_Lang_simple_stuff</id>
	<title>C Lang simple stuff - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pedromussato.com/index.php?action=history&amp;feed=atom&amp;title=C_Lang_simple_stuff"/>
	<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=C_Lang_simple_stuff&amp;action=history"/>
	<updated>2026-04-10T09:33:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.pedromussato.com/index.php?title=C_Lang_simple_stuff&amp;diff=24&amp;oldid=prev</id>
		<title>413vhcu1lq0463ob: Created page with &quot;== All C keywords == {| class=&quot;wikitable&quot; |auto |break |case |char |- |const |continue |default |do |- |double |else |enum |extern |- |float |for |goto |if |- |int |long |register |return |- |short |signed |sizeof |static |- |struct |switch |typedef |union |- |unsigned |void |volatile |while |}  == C Lang basics ==  === Primitive types ===  * char: Typically 1 byte in size. It&#039;s used to store characters or small integers. * int: The most common integer type, typically at...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pedromussato.com/index.php?title=C_Lang_simple_stuff&amp;diff=24&amp;oldid=prev"/>
		<updated>2024-10-06T22:35:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== All C keywords == {| class=&amp;quot;wikitable&amp;quot; |auto |break |case |char |- |const |continue |default |do |- |double |else |enum |extern |- |float |for |goto |if |- |int |long |register |return |- |short |signed |sizeof |static |- |struct |switch |typedef |union |- |unsigned |void |volatile |while |}  == C Lang basics ==  === Primitive types ===  * char: Typically 1 byte in size. It&amp;#039;s used to store characters or small integers. * int: The most common integer type, typically at...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== All C keywords ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|auto&lt;br /&gt;
|break&lt;br /&gt;
|case&lt;br /&gt;
|char&lt;br /&gt;
|-&lt;br /&gt;
|const&lt;br /&gt;
|continue&lt;br /&gt;
|default&lt;br /&gt;
|do&lt;br /&gt;
|-&lt;br /&gt;
|double&lt;br /&gt;
|else&lt;br /&gt;
|enum&lt;br /&gt;
|extern&lt;br /&gt;
|-&lt;br /&gt;
|float&lt;br /&gt;
|for&lt;br /&gt;
|goto&lt;br /&gt;
|if&lt;br /&gt;
|-&lt;br /&gt;
|int&lt;br /&gt;
|long&lt;br /&gt;
|register&lt;br /&gt;
|return&lt;br /&gt;
|-&lt;br /&gt;
|short&lt;br /&gt;
|signed&lt;br /&gt;
|sizeof&lt;br /&gt;
|static&lt;br /&gt;
|-&lt;br /&gt;
|struct&lt;br /&gt;
|switch&lt;br /&gt;
|typedef&lt;br /&gt;
|union&lt;br /&gt;
|-&lt;br /&gt;
|unsigned&lt;br /&gt;
|void&lt;br /&gt;
|volatile&lt;br /&gt;
|while&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== C Lang basics ==&lt;br /&gt;
&lt;br /&gt;
=== Primitive types ===&lt;br /&gt;
&lt;br /&gt;
* char: Typically 1 byte in size. It&amp;#039;s used to store characters or small integers.&lt;br /&gt;
* int: The most common integer type, typically at least 2 bytes in size.&lt;br /&gt;
* short: Short integer, usually smaller than int.&lt;br /&gt;
* long: Long integer, typically larger than int.&lt;br /&gt;
* long long: Very long integer, introduced in C99, typically larger than long.&lt;br /&gt;
* float: Single-precision floating-point type.&lt;br /&gt;
* double: Double-precision floating-point type.&lt;br /&gt;
* long double: Extended-precision floating-point type, larger than double.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic operators ===&lt;br /&gt;
&lt;br /&gt;
* Addition (+): Adds two operands.&lt;br /&gt;
* Subtraction (-): Subtracts the right operand from the left operand.&lt;br /&gt;
* Multiplication (*): Multiplies two operands.&lt;br /&gt;
* Division (/): Divides the left operand by the right operand. If both operands are integers, the result is an integer (truncated towards zero).&lt;br /&gt;
* Modulus (%): Computes the remainder of dividing the left operand by the right operand.&lt;br /&gt;
* Increment (++): Increases the value of the operand by 1.&lt;br /&gt;
* Decrement (--): Decreases the value of the operand by 1.&lt;br /&gt;
&lt;br /&gt;
Operator Precedence: Operators like *, /, % have higher precedence over + and -. Use parentheses to enforce desired evaluation order if needed.&lt;br /&gt;
&lt;br /&gt;
Increment and Decrement: ++ and -- can be used as prefix (++a, --b) or postfix (a++, b--). Their behavior can differ in expressions due to their prefix/postfix position.&lt;br /&gt;
&lt;br /&gt;
Division and Modulus: Division / truncates towards zero, meaning it discards any fractional part in integer division. Modulus % computes the remainder after division.&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
* Logical AND &amp;amp;&amp;amp;: Returns true if both operands are true, otherwise returns false.&lt;br /&gt;
* Logical OR ||: Returns true if at least one of the operands is true, otherwise returns false.&lt;br /&gt;
* Logical NOT !: Reverses the logical state of its operand. If the operand is true, ! makes it false, and vice versa.&lt;br /&gt;
&lt;br /&gt;
Short-circuit Evaluation: For &amp;amp;&amp;amp; and || operators, the right-hand side operand is evaluated only if necessary. This means that if the outcome of the expression can be determined by evaluating only the left-hand side operand, the right-hand side operand is not evaluated. This behavior is useful for optimizing code and preventing unnecessary computations.&lt;br /&gt;
&lt;br /&gt;
Operator Precedence: ! has higher precedence than &amp;amp;&amp;amp; and ||. Use parentheses to control the order of operations if needed.&lt;br /&gt;
&lt;br /&gt;
Boolean Context: In C, any non-zero value is considered true, and zero is considered false. However, it&amp;#039;s good practice to use explicit boolean values (true or false) where clarity is important.&lt;br /&gt;
&lt;br /&gt;
=== Relational operators ===&lt;br /&gt;
&lt;br /&gt;
* Equal to ==: Checks if the values of two operands are equal.&lt;br /&gt;
* Not equal to !=: Checks if the values of two operands are not equal.&lt;br /&gt;
* Greater than &amp;gt;: Checks if the left operand is greater than the right operand.&lt;br /&gt;
* Less than &amp;lt;: Checks if the left operand is less than the right operand.&lt;br /&gt;
* Greater than or equal to &amp;gt;=: Checks if the left operand is greater than or equal to the right operand.&lt;br /&gt;
* Less than or equal to &amp;lt;=: Checks if the left operand is less than or equal to the right operand.&lt;br /&gt;
&lt;br /&gt;
Relational operators are primarily used in conditional statements (if, else if, while, for, etc.) to make decisions based on comparisons between variables or constants.&lt;br /&gt;
&lt;br /&gt;
Each relational operator evaluates to either true (1) or false (0) based on the outcome of the comparison.&lt;br /&gt;
&lt;br /&gt;
The operands can be variables, constants, or expressions that evaluate to compatible data types (e.g., integers, characters).&lt;br /&gt;
&lt;br /&gt;
=== if else if else ===&lt;br /&gt;
 if (condition) {&lt;br /&gt;
     //code block&lt;br /&gt;
 } else if (condition2) {&lt;br /&gt;
     //code block &lt;br /&gt;
 } else {&lt;br /&gt;
     //code block &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== switch case ===&lt;br /&gt;
 switch (expression) {&lt;br /&gt;
     case constant1:&lt;br /&gt;
         //code block &lt;br /&gt;
         break;&lt;br /&gt;
     case constant2:&lt;br /&gt;
         //code block &lt;br /&gt;
         break;&lt;br /&gt;
     default:&lt;br /&gt;
         //code block &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== for ===&lt;br /&gt;
 for (int i = 0; i &amp;lt; 10; i++) { &lt;br /&gt;
     //code block &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== while ===&lt;br /&gt;
 int i = 0;&lt;br /&gt;
 while (i &amp;lt; 10) {&lt;br /&gt;
     //code block &lt;br /&gt;
     i++;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== do while ===&lt;br /&gt;
 int i = 0;&lt;br /&gt;
 do {&lt;br /&gt;
     //code block&lt;br /&gt;
     i++;&lt;br /&gt;
 } while (i &amp;lt; 10);&lt;br /&gt;
&lt;br /&gt;
=== function ===&lt;br /&gt;
 return_type function_name(parameter_list) {&lt;br /&gt;
     // Function body (statements)&lt;br /&gt;
     // Local variable declarations&lt;br /&gt;
 &lt;br /&gt;
     // Statements&lt;br /&gt;
     return expression; // Optional return statement&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Get Input And Printing Out On Terminal ==&lt;br /&gt;
At the beginning of the file include stdio.h&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== read ===&lt;br /&gt;
 scanf(&amp;quot;type&amp;quot;, destinationVariable);&lt;br /&gt;
&lt;br /&gt;
=== print ===&lt;br /&gt;
 printf(&amp;quot;Text here.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== types ===&lt;br /&gt;
&lt;br /&gt;
* %d: Reads an integer value into an int.&lt;br /&gt;
* %ld: Reads a long integer value into a long.&lt;br /&gt;
* %lld: Reads a long long integer value into a long long.&lt;br /&gt;
* %f: Reads a floating-point value into a float.&lt;br /&gt;
* %lf: Reads a double-precision floating-point value into a double.&lt;br /&gt;
* %c: Reads a single character into a char.&lt;br /&gt;
* %s: Reads a string of characters into a character array (char[]).&lt;br /&gt;
* %u: Reads an unsigned integer into an unsigned int.&lt;br /&gt;
* %lu: Reads an unsigned long integer into an unsigned long.&lt;br /&gt;
* %llu: Reads an unsigned long long integer into an unsigned long long.&lt;br /&gt;
&lt;br /&gt;
(e.g.)&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 int main(int argc, char **argv) {&lt;br /&gt;
     int n = 0;&lt;br /&gt;
     printf(&amp;quot;Please a number:\n&amp;quot;);&lt;br /&gt;
     scanf(&amp;quot;%d&amp;quot;, &amp;amp;n);&lt;br /&gt;
     printf(&amp;quot;You entered number: %d\n&amp;quot;, n);&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>413vhcu1lq0463ob</name></author>
	</entry>
</feed>