Textbook Notes (368,652)
Canada (162,033)
COMP 2404 (3)
Chapter 2


9 Pages
Unlock Document

Computer Science
COMP 2404
Christine Laurendeau

Carleton University School of Computer ScienceCOMP 2404Introduction to Software EngineeringFall 2014Scribes Note These are only TEXTBOOK notes For those taking this class with Dr Laurendeau her tests are things she mentions in the lectures or assignments YMMVDeitel Harvey M and Paul J Deitel C how to program 8th ed Upper Saddle River NJ Prentice Hall 2012Chapter 2Introduction to C ProgrammingTopics21Introduction22First Program in C Printing a Line of Text23Modifying Our First C Program24Another C Program Adding Integers25Memory Concepts26Arithmetic27Decision Making Equality and Relational Operators28WrapUp21 Introductionbelow are ve examples that demonstrate how your programs can display messages and obtain information from the user for processing the rst three examples simply display messages on the screen the next obtains two numbers from a user calculates their sum and displays the result the fth example demonstrates decisionmaking by showing you how to compare two numbers 22 First Program in C Printing a Line of Text Fig 21 fig0201cpp Textprinting programinclude iostreamallows program to output data to the screen function main begins program executionint mainstdcoutWelcome to Cndisplay messagereturn 0indicate that program ended successfullyend function mainOutputWelcome to CCommentsLines 1 and 2 Fig 21 fig0201cpp Textprinting programbegin with indicating that the remainder of each line is a commentYou also may use C style commentspossibly containing many linesbegins withand ends with19
More Less

Related notes for COMP 2404

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.