esthicodes / Ella_Learns_C

This is a repository where Ella uploads documents and codes where she learns with Elice and CS50.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ella_Learns_C

This is a repository where Ella uploads documents and codes where she learns with Elice and CS50.

++i:

incrementing (i++): “variable1 is incremented (i.e. variable1 = variable1 + 1). But the value of it before incrementing is returned”

Compared to prefix incrementing (++i): “variable2 is incremented (i.e. variable1 = variable1 + 1) and its value is returned”

https://www.youtube.com/watch?v=XZMDIFbWpVI https://www.programiz.com/c-programming/c-for-loop

mkdir decrement operator increment operator semicolon;

https://cs50.harvard.edu/x/2021/psets/1/mario/more/ https://cs50.harvard.edu/x/2021/psets/1/mario/less/

https://cs50.harvard.edu/x/2021/psets/1/cash/

5:04 PM

원혜연 C, a general computer programming language, was first used in 1972 and has become one of the most widely studied fields in terms of computer science. One of the basic things that one needs to know is to add “” on the top of their codes to use the command “printf”.

Stdio.h is the shortened version of the word Standard input output header file, which allows one to use the built-in function of printf, which stands for print formatted. There are also other header files such as ,, , and . The C program begins from the command “int main()” so, one should use this after he or she includes the files that one needs.

One should then use curly brackets, which are used to indicate the start of the function. Many computer experts may be familiar with the term “get_string(“”)”. This means that the words inside the two quotation marks are answer codes in terms of the program “scratch”. If one wants to prove that two variables are the same, he or she is obliged to use functions that are usually different in each language. A function is simply a few statements together that finish a task.

5:05 PM

원혜연 One can also use the command “help50” in the terminal to figure out the problems in one’s source code.

5:06 PM counter += 1;

5:18 PM incrementing (i++): “variable1 is incremented (i.e. variable1 = variable1 + 1). But the value of it before incrementing is returned”

Compared to prefix incrementing (++i): “variable2 is incremented (i.e. variable1 = variable1 + 1) and its value is returned”

5:20 PM var isLeapYear = function(year) { return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); };

var count = 0;

for (i = 2001; i < 3000; i++){ if (isLeapYear(i)){ count++; } }

5:21 PM #include int main() { int var1 = 5, var2 = 5;

// 5 is displayed // Then, var1 is increased to 6. printf(“%d\n”, var1++);

// var2 is increased to 6 // Then, it is displayed. printf(“%d\n”, ++var2);

return 0; }

5:30 PM gcc var.c -o executable

5:34 PM “”

5:37 PM https://cs50.harvard.edu/x/2021/psets/1/mario/less/

5:42 PM ~/ $ mkdir ~/pset1/mario

mkdir ~/pset1/mario

help50

n = get_int

(“Height: “)

5:59 PM (“Height:”)

6:00 PM (n)

n < 1 || n > 8

6:03 PM for (int i = 0; i < n; )

for (initializationStatement; testExpression; updateStatement) { // statements inside the body of loop }

6:07 PM https://cs50.harvard.edu/x/2021/psets/1/mario/less/

https://cs50.harvard.edu/x/2021/psets/1/mario/more/

About

This is a repository where Ella uploads documents and codes where she learns with Elice and CS50.


Languages

Language:Python 100.0%