arrays, file and function...help please.

Write a function swap that accepts an integer array and two integers pos1, pos2, representing two locations in the array. the function should swap the contents of the two locations. assume that pos1 and pos2 are valid.


write a c program that accepts a text file 'in.dat' and obtains two integers. assume the file contains two integers seperated by a space. Next print out the integer in reverse order, followed by thier sum and product..
example:
given:5 10
program print outs:10 5 15 50

i am preparing for an exam tomorrow and i ran across these questions.... how are these done...please help.
If you make an attempt at solving them and post your code, we can help you. Nobody is going to just post the solutions for you (or at least they shouldn't).
Topic archived. No new replies allowed.