SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
This is CS50.
scribe notes
problem set 0
walkthrough
  cs50.net/psets
sectioning
 cs50.net/section
office hours
   cs50.net/ohs
int	
  main(void)
{
	
  	
  	
  	
  printf("hello,	
  world!n");
	
  	
  	
  	
  return	
  0;
}
statements
statements




printf("hello,	
  world!n");
loops
loops



while	
  (true)
{
	
  	
  	
  	
  printf("hello,	
  world!n");
}
loops
loops



for	
  (int	
  i	
  =	
  0;	
  i	
  <	
  10;	
  i++)
{
	
  	
  	
  	
  printf("hello,	
  world!n");
}
variables
variables

      int	
  counter	
  =	
  0;
      while	
  (true)
       {
       	
  	
  	
  	
  printf("%dn",	
  counter);
      	
  	
  	
  	
  counter++;
      }
Boolean expressions
Boolean expressions




                (x	
  <	
  y)
   ((x	
  <	
  y)	
  &&	
  (y	
  <	
  z))
conditions
      if	
  (x	
  <	
  y)
      {
       	
  	
  	
  	
  printf("x	
  is	
  less	
  than	
  yn");
       }
      else	
  if	
  (x	
  >	
  y)
      {
      	
  	
  	
  	
  printf("x	
  is	
  greater	
  than	
  yn");	
  
      }
      else
      {
      	
  	
  	
  	
  printf("x	
  is	
  equal	
  to	
  yn");
      }
arrays




string	
  inventory[1];
inventory[0]	
  =	
  "Orange";
#include	
  <stdio.h>

int	
  main(void)
{
 	
  	
  	
  	
  printf("hello,	
  world!");
	
  	
  	
  	
  return	
  0;
 }
10000011   00000001   00010001   00000000 00111101   11111100   01110100   00111101
00000000   01000000   00000000   00000000 00000000   00000000   00000000   00000000
10010000   00000000   00000000   00000000 01010000   00000000   00000111   00110000
00001011   00000001   00001011   00000011 00001010   00000000   00000000   00000000
00000000   00100000   00000000   00000000 00000000   00000000   00000000   00000000
00000000   00100000   00000000   00000000 00000000   00000000   00000000   00000000
00000000   00000000   00000000   00000000 00000000   00000000   00000000   00000000
01110000   00010000   00000000   00100000 00000001   00000000   00000000   00000000
00000000   00000000   00000000   00100000 00000001   00000000   00000000   00000000
00000000   00000000   00000000   01000000 00000001   00000000   00000000   00000000
00000000   00100000   00000000   01000000 00000001   00000000   00000000   00000000
11111111   11111111   11111111   11111111 11111111   11111111   11111111   11111111
10010000   10000000   00000000   01000000 00000001   00000000   00000000   00000000
00101110   01100100   01111001   01101110 01100001   01101101   01101001   01100011
10110000   00000100   00000000   00100000 00000001   00000000   00000000   00000000
10110000   00000100   00000000   00100000 00000001   00000000   00000000   00000000
10100000   00000001   00000000   00000000 00000000   00000000   00000000   00000000
10110000   00000100   00000000   00000000 00000000   00000000   00000000   00000000
00000000   00000000   00000000   00000000 00000000   00000000   00000000   00000000
00000000   00000000   00000000   00000000 00000000   00000000   00000000   00000000
00000000   00000000   00000000   00000000 00000000   00100000   00000000   00000000
                                        ...
how to write a program
how to compile a program
        clang	
  hello.c
how to run a program
        ./a.out
how to compile a program
      clang	
  -­‐o	
  hello	
  hello.c
how to run a program
        ./hello
how to compile a program
         make	
  hello
functions
   main
Standard Library
              stdio.h

printf

...
CS50 Library
                  cs50.h

GetChar

GetDouble

GetFloat

GetInt

GetLongLong

GetString
printf
%c	
  	
  	
  %d	
  	
  	
  %f	
  	
  	
  %lld	
  	
  	
  %s	
  	
  	
  ...
escape sequences
n	
  	
  	
  r	
  	
  	
  t	
  	
  	
  '	
  	
  	
  "	
  	
  	
  	
  	
  	
  0	
  	
  	
  ...
math
+	
  	
  	
  -­‐	
  	
  	
  *	
  	
  	
  /	
  	
  	
  %
primitive types
char	
  	
  	
  double	
  	
  	
  float	
  	
  	
  int	
  	
  	
  long	
  long	
  	
  	
  ...
CS50 types
bool	
  	
  	
  string	
  	
  	
  ...
precedence




             http://www.difranco.net/cop2220/op-prec.htm
how to compile a program
    clang	
  -­‐o	
  hello	
  hello.c	
  -­‐lcs50
how to compile a program
         make	
  hello
to be continued...

Más contenido relacionado

La actualidad más candente

SPL 10.1 | Manual Tracing on Basic Loop & 1D Array
SPL 10.1 | Manual Tracing on Basic Loop & 1D ArraySPL 10.1 | Manual Tracing on Basic Loop & 1D Array
SPL 10.1 | Manual Tracing on Basic Loop & 1D ArrayMohammad Imam Hossain
 
Verificacion de notas
Verificacion de notasVerificacion de notas
Verificacion de notasLuis Gonzalez
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem Topics MixeR
 
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosLT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosDNAD
 
Log Rule for Derivatives
Log Rule for DerivativesLog Rule for Derivatives
Log Rule for DerivativesPhil Clark
 
Kotlin - Null safety
Kotlin - Null safetyKotlin - Null safety
Kotlin - Null safetyss90311
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word documentshashank777172
 
IB Maths. Power rule
IB Maths. Power ruleIB Maths. Power rule
IB Maths. Power ruleestelav
 
Interference vs. noise
Interference vs. noiseInterference vs. noise
Interference vs. noiseZanyar Anwer
 
Urban Sprawl - European vision
Urban Sprawl - European vision Urban Sprawl - European vision
Urban Sprawl - European vision Emm. Verigos
 
Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]Mozammel Haque
 
Por qué Crystal? Why Crystal Language?
Por qué Crystal? Why Crystal Language?Por qué Crystal? Why Crystal Language?
Por qué Crystal? Why Crystal Language?Crystal Language
 

La actualidad más candente (18)

SPL 10.1 | Manual Tracing on Basic Loop & 1D Array
SPL 10.1 | Manual Tracing on Basic Loop & 1D ArraySPL 10.1 | Manual Tracing on Basic Loop & 1D Array
SPL 10.1 | Manual Tracing on Basic Loop & 1D Array
 
Ecuaciones Movimiento
Ecuaciones MovimientoEcuaciones Movimiento
Ecuaciones Movimiento
 
Consulta de notas
Consulta de notasConsulta de notas
Consulta de notas
 
Verificacion de notas
Verificacion de notasVerificacion de notas
Verificacion de notas
 
変数の型 - Java 演習
変数の型 - Java 演習 変数の型 - Java 演習
変数の型 - Java 演習
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem
 
COMPUTER GRAPHICS
COMPUTER GRAPHICSCOMPUTER GRAPHICS
COMPUTER GRAPHICS
 
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmosLT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos
 
week-23x
week-23xweek-23x
week-23x
 
Log Rule for Derivatives
Log Rule for DerivativesLog Rule for Derivatives
Log Rule for Derivatives
 
Kotlin - Null safety
Kotlin - Null safetyKotlin - Null safety
Kotlin - Null safety
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word document
 
IB Maths. Power rule
IB Maths. Power ruleIB Maths. Power rule
IB Maths. Power rule
 
Interference vs. noise
Interference vs. noiseInterference vs. noise
Interference vs. noise
 
Urban Sprawl - European vision
Urban Sprawl - European vision Urban Sprawl - European vision
Urban Sprawl - European vision
 
Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]Beginning web programming with PHP [PHP 101-02]
Beginning web programming with PHP [PHP 101-02]
 
Midi pc to_cc_port_for_kontakt_marcelo port
Midi pc to_cc_port_for_kontakt_marcelo portMidi pc to_cc_port_for_kontakt_marcelo port
Midi pc to_cc_port_for_kontakt_marcelo port
 
Por qué Crystal? Why Crystal Language?
Por qué Crystal? Why Crystal Language?Por qué Crystal? Why Crystal Language?
Por qué Crystal? Why Crystal Language?
 

Destacado

How to hypnotize yourself
How to hypnotize yourselfHow to hypnotize yourself
How to hypnotize yourselfPeter McMahon
 
We make predicting the future easy
We make predicting the future easyWe make predicting the future easy
We make predicting the future easyChristian Aspegren
 
Obeservation
ObeservationObeservation
Obeservationwhiscard
 
Treating anxiety and depression
Treating anxiety and depressionTreating anxiety and depression
Treating anxiety and depressionPeter McMahon
 
Adg selected projects linked in 2012
Adg selected projects   linked in 2012Adg selected projects   linked in 2012
Adg selected projects linked in 2012Anne-Marie Funk
 
Digital Numbers In Indonesia - update version (landscape)
Digital Numbers In Indonesia - update version (landscape)Digital Numbers In Indonesia - update version (landscape)
Digital Numbers In Indonesia - update version (landscape)Seno Pramuadji
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linuxChih-Min Chao
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List KataOlve Maudal
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 

Destacado (17)

How to hypnotize yourself
How to hypnotize yourselfHow to hypnotize yourself
How to hypnotize yourself
 
Agile Paper Cutter
Agile Paper CutterAgile Paper Cutter
Agile Paper Cutter
 
Välj bättre inomhusluft
Välj bättre inomhusluftVälj bättre inomhusluft
Välj bättre inomhusluft
 
We make predicting the future easy
We make predicting the future easyWe make predicting the future easy
We make predicting the future easy
 
Obeservation
ObeservationObeservation
Obeservation
 
Treating anxiety and depression
Treating anxiety and depressionTreating anxiety and depression
Treating anxiety and depression
 
Adg selected projects linked in 2012
Adg selected projects   linked in 2012Adg selected projects   linked in 2012
Adg selected projects linked in 2012
 
Pmcmahon pptx
Pmcmahon pptx Pmcmahon pptx
Pmcmahon pptx
 
American diabetes month
American diabetes monthAmerican diabetes month
American diabetes month
 
Apoldissi_Brochure_LR
Apoldissi_Brochure_LRApoldissi_Brochure_LR
Apoldissi_Brochure_LR
 
Digital Numbers In Indonesia - update version (landscape)
Digital Numbers In Indonesia - update version (landscape)Digital Numbers In Indonesia - update version (landscape)
Digital Numbers In Indonesia - update version (landscape)
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List Kata
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
The iPhone Evolution
The iPhone EvolutionThe iPhone Evolution
The iPhone Evolution
 
Deep C
Deep CDeep C
Deep C
 

Similar a Week1m

Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Dylan Field
 
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxCS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxrawdnsr
 
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxCS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxrawdnsr
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)yap_raiza
 
Tecnicas avanzadas con CSS3
Tecnicas avanzadas con CSS3Tecnicas avanzadas con CSS3
Tecnicas avanzadas con CSS3Marta Armada
 
Sketch sort ochadai20101015-public
Sketch sort ochadai20101015-publicSketch sort ochadai20101015-public
Sketch sort ochadai20101015-publicYasuo Tabei
 
Maze solving app listing
Maze solving app listingMaze solving app listing
Maze solving app listingChris Worledge
 
Exact Real Arithmetic for Tcl
Exact Real Arithmetic for TclExact Real Arithmetic for Tcl
Exact Real Arithmetic for Tclke9tv
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinAndrey Breslav
 
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...Security Session
 
Compilation process
Compilation processCompilation process
Compilation processAlex Denisov
 
"Internationalisation with PHP and Intl" source code
"Internationalisation with PHP and Intl" source code"Internationalisation with PHP and Intl" source code
"Internationalisation with PHP and Intl" source codeDaniel_Rhodes
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrencyjgrahamc
 
5. php bangla tutorial php basic
5. php bangla tutorial php basic5. php bangla tutorial php basic
5. php bangla tutorial php basicSamimKhan19
 

Similar a Week1m (20)

Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
 
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxCS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
 
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptxCS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
 
Tecnicas avanzadas con CSS3
Tecnicas avanzadas con CSS3Tecnicas avanzadas con CSS3
Tecnicas avanzadas con CSS3
 
Introduction to c part -1
Introduction to c   part -1Introduction to c   part -1
Introduction to c part -1
 
Sketch sort ochadai20101015-public
Sketch sort ochadai20101015-publicSketch sort ochadai20101015-public
Sketch sort ochadai20101015-public
 
SPL 8 | Loop Statements in C
SPL 8 | Loop Statements in CSPL 8 | Loop Statements in C
SPL 8 | Loop Statements in C
 
Maze solving app listing
Maze solving app listingMaze solving app listing
Maze solving app listing
 
Exact Real Arithmetic for Tcl
Exact Real Arithmetic for TclExact Real Arithmetic for Tcl
Exact Real Arithmetic for Tcl
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in Kotlin
 
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
Robots against robots: How a Machine Learning IDS detected a novel Linux Botn...
 
Compilation process
Compilation processCompilation process
Compilation process
 
05 2 관계논리비트연산
05 2 관계논리비트연산05 2 관계논리비트연산
05 2 관계논리비트연산
 
01.introduction.ppt
01.introduction.ppt01.introduction.ppt
01.introduction.ppt
 
"Internationalisation with PHP and Intl" source code
"Internationalisation with PHP and Intl" source code"Internationalisation with PHP and Intl" source code
"Internationalisation with PHP and Intl" source code
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
Tu1
Tu1Tu1
Tu1
 
Vcs5
Vcs5Vcs5
Vcs5
 
5. php bangla tutorial php basic
5. php bangla tutorial php basic5. php bangla tutorial php basic
5. php bangla tutorial php basic
 

Último

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Último (20)

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 

Week1m

  • 6. office hours cs50.net/ohs
  • 7.
  • 8.
  • 9.
  • 10. int  main(void) {        printf("hello,  world!n");        return  0; }
  • 13. loops
  • 14. loops while  (true) {        printf("hello,  world!n"); }
  • 15. loops
  • 16. loops for  (int  i  =  0;  i  <  10;  i++) {        printf("hello,  world!n"); }
  • 18. variables int  counter  =  0; while  (true) {        printf("%dn",  counter);        counter++; }
  • 20. Boolean expressions (x  <  y) ((x  <  y)  &&  (y  <  z))
  • 21. conditions if  (x  <  y) {        printf("x  is  less  than  yn"); } else  if  (x  >  y) {        printf("x  is  greater  than  yn");   } else {        printf("x  is  equal  to  yn"); }
  • 23. #include  <stdio.h> int  main(void) {        printf("hello,  world!");        return  0; }
  • 24. 10000011 00000001 00010001 00000000 00111101 11111100 01110100 00111101 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 10010000 00000000 00000000 00000000 01010000 00000000 00000111 00110000 00001011 00000001 00001011 00000011 00001010 00000000 00000000 00000000 00000000 00100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01110000 00010000 00000000 00100000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00100000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 01000000 00000001 00000000 00000000 00000000 00000000 00100000 00000000 01000000 00000001 00000000 00000000 00000000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10010000 10000000 00000000 01000000 00000001 00000000 00000000 00000000 00101110 01100100 01111001 01101110 01100001 01101101 01101001 01100011 10110000 00000100 00000000 00100000 00000001 00000000 00000000 00000000 10110000 00000100 00000000 00100000 00000001 00000000 00000000 00000000 10100000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 10110000 00000100 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00100000 00000000 00000000 ...
  • 25.
  • 26. how to write a program
  • 27. how to compile a program clang  hello.c
  • 28. how to run a program ./a.out
  • 29. how to compile a program clang  -­‐o  hello  hello.c
  • 30. how to run a program ./hello
  • 31. how to compile a program make  hello
  • 32. functions main
  • 33. Standard Library stdio.h printf ...
  • 34. CS50 Library cs50.h GetChar GetDouble GetFloat GetInt GetLongLong GetString
  • 35. printf %c      %d      %f      %lld      %s      ...
  • 36. escape sequences n      r      t      '      "            0      ...
  • 37. math +      -­‐      *      /      %
  • 38. primitive types char      double      float      int      long  long      ...
  • 39. CS50 types bool      string      ...
  • 40. precedence http://www.difranco.net/cop2220/op-prec.htm
  • 41. how to compile a program clang  -­‐o  hello  hello.c  -­‐lcs50
  • 42. how to compile a program make  hello