Homework6-4 - double a[20 b[20 fpin =...

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

View Full Document Right Arrow Icon
Homework #6 /* * Program HW6_4 * Written by Justin Waters * Inputs: values from 2 different sized arrays * Outputs: 1 combined array of unique values only * Description: The program will take values from 2 different sized array and combine all the unique values into one array. * */ #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> int main (void) { FILE *fpin; FILE *fpout; int p=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
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double a[20], b[20]; fpin = fopen("array.txt", "r"); fpout = fopen("arr1.txt", "w"); if (fpin == NULL) { printf("File does not exist"); exit(1); } while(fscanf(fpin, "%lf %lf", &a[p], &b[p]) != EOF) { fprintf(fpout,"%lf", a[p]); p++; } printf("%lf %lf %lf %lf %lf %lf %lf %lf", a[0], a[1], a[2],a[3],a[4],b[0],b[1],b[2]); fclose(fpin); fclose(fpout); return(0); }...
View Full Document

This note was uploaded on 08/06/2008 for the course EGR 261 taught by Professor Parikh during the Spring '08 term at Grand Valley State.

Page1 / 2

Homework6-4 - double a[20 b[20 fpin =...

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