Notes - 2.12 - -Put true as the while-Only way to break is...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
, E E 312 Notes February 12 2008 Know Source Lines of Codes Know how many hours you spent on your assignment o # Need to do this for Assignment 2 Global Variables o Also called external variables o Are declared outside of your main function o Should not use it because it is confusing o () Declare int I declarations in main o Local Variables are inside main function Parameters o Same as local values o Get values within function o But passed inside function calls Block o Anything surrounded by curly braces o Can declare variables o Only scope within that block Scope Rules o Declare a value for a variable that is already a local variables and global variable . has the meaning inside the block but will return to its global variable value Test Review Variables and assignments / Formatted i o
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Control statements Arrays Functions Scope of variables Loops - Count Controlled Loops - For and if - Event Controlled Loops - While - Can have infinite loops
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -Put true as the while-Only way to break is to put a break statement-Continues goes back to checking the condition Tracing a Loop Execution Review Execercise . 1 Number of Directives . 1 1 Directive . 2 Number of Statements . 1 4 statements . 2 Need to know definitions . 3 Keywords in C . 1 , , , For main printf while . 2 not If . i , Main and printf are names of functions not keywords . 4 Write a program to get volume of a cube . 1 < . > Include stdio h . 2 ( ){ Int main void . 3 = ; Int r 10 . 4 = . Int p 3 14 . 5 ; Float v . 6 = (( ) ( * * ))/ ; V 4 p r r r 3 . 7 (“ : % ”, ); Printf the volume of a cube with a 10 meter radius f v . 5-, Write a program that ask the user to enter a two digit number then prints the . number with its digit reversed . 1 < . > Include stdio h . 2 ( ){ Int main void . 3 ; Int n...
View Full Document

This note was uploaded on 03/22/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas.

Page1 / 3

Notes - 2.12 - -Put true as the while-Only way to break is...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online