pa4_q1 anon

pa4_q1 anon - /for loop assigns difference to new array...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 /*This program determines the absolute difference between the respective values in two arrays. bugs: none Created 31 Oct.*/ #include <stdio.h> #include <math.h> int main (void) { int numbers1[3], numbers2[3], difference[3], i, j printf ("Please enter the 3 numbers: ") printf ("Please enter 3 more numbers: ")
Background image of page 1

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

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

Unformatted text preview: //for loop assigns difference to new array. starts at 0 and it less than 2 so there are 3 ints for (i=0 { //at this point, difference isn't absolute, so i have to cast it in printf function difference[i] = numbers1[i] - numbers2[i] } printf (&amp;quot;The absolute difference between the respective numbers is %d, and %d, %d&amp;quot;, abs (difference[0]), abs (difference[1]), a return 0 } Sheet1 Page 2 i&amp;lt;3 i++)...
View Full Document

This note was uploaded on 11/02/2009 for the course COSI 11a taught by Professor Dilillo during the Spring '09 term at Brandeis.

Page1 / 2

pa4_q1 anon - /for loop assigns difference to new array...

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