Practice_problems_mi - ECE 175 Computer Programming for Engineering Applications Basics of the C language Page 1 of 3 1 Write the Unix command that

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

View Full Document Right Arrow Icon
ECE 175: Computer Programming for Engineering Applications Page 1 of 3 Basics of the C language 1. Write the Unix command that will compile a C program named numbers.c with the option to use the debugger and linking the math library (1 pt). 2. D efine a constant named VAR1 and assign it the value of 10 (1 pt). 3. Which of the following names are valid variable names? (4 pts). a. Var1 b. 3table c. char d. _Y_ 4. What is the output of the following block of code? (2 pts). { int x = 6, y = 9; x = x + y; y = y x; x = y/x; printf(“%d \ t %d”, x, y); } 5. Write an if statement that checks whether an integer number x is even and a multiple of 5. If so, it prints “Number x is even and a multiple of five”, else it prints “Not the right number” (2 pts). 6. What values are being assigned to x in the following block of code at each line when y=15.0 (5 pts)? x = 25.0; if (y!=(x-10)) { x = x-10.0;} else { x = x/2.0;}
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/06/2010 for the course ECE 175 taught by Professor Grubbs during the Spring '08 term at University of Arizona- Tucson.

Page1 / 3

Practice_problems_mi - ECE 175 Computer Programming for Engineering Applications Basics of the C language Page 1 of 3 1 Write the Unix command that

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

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