Lecture02-w01-LIN-09062019-IntroC_Binary.pdf - Computing I COMP.1010 Fall 2019 Lecture 2 Basics in C Computer Science By Sirong Lin PhD University of

Lecture02-w01-LIN-09062019-IntroC_Binary.pdf - Computing I...

This preview shows page 1 - 11 out of 39 pages.

Computing I By: Sirong Lin, PhD COMP.1010, Fall 2019 University of Massachusetts Lowell Lecture 2: Basics in C & Computer Science
Image of page 1
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Get a white paper before the class starts 2
Image of page 2
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Upcoming Due Dates 3 Due Date Week 01 Practice 1 09-08-2019 (Su), 9:00pm Daily 01 09-09-2019 (M), 9:00pm Week 01-Reading 2& Practice 2 09-10-2019 (Tu), 9:00pm Week 02 Reading 1-3 MWF, 9:00am Daily 02 09-11-2019 (F), 9:00pm Week 02 Practice 09-15-2019 (Su), 9:00pm
Image of page 3
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Time to test your memory! Please write down the Hello World C Program 4
Image of page 4
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Outline Smallest Valid code in C Hello World code in C Binary System 5
Image of page 5
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Smallest valid C code every C program must contain one (and only one) main function a program starts from main function 6 int main (int argc, char *argv[]) { return 0 ; }
Image of page 6
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Smallest valid C code at the end of main function, it always return an integer value (int) 0: means return a “successful” result non-zero number: “unsuccessful” result 7 int main (int argc, char *argv[]) { return 0 ; }
Image of page 7
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Smallest valid C code main function’s parameters in this class, always use main(int argc, char *argv[]) when you write your own program though zyBook uses main(void), or others use main() 8 int main (int argc, char *argv[]) { return 0 ; }
Image of page 8
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Smallest valid C code (Cont’d) { indicates the beginning of a block of code } indicates the end of a block of code they must appear in pairs every line of code inside should be indented, to achieve a good programming style 9 int main(int argc, char *argv[]) { return 0; }
Image of page 9
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Smallest valid C code (Cont’d) return 0: executable statements — program
Image of page 10
Image of page 11

You've reached the end of your free preview.

Want to read all 39 pages?

  • Fall '15

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors