Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int v1, v2, sum;
- FILE *fp, *fpw;
- fp = fopen("F:\\input.txt", "r");
- fpw = fopen("F:\\output.txt", "w");
- while(fscanf(fp, "%d %d", &v1, &v2) != EOF)
- {
- sum = v1 + v2;
- fprintf(fpw, "Sum of %d and %d is = %d\n", v1, v2, sum);
- }
- fclose(fp);
- fclose(fpw);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement