Programming Help In C

Thread Starter

doo20000

Joined Apr 2, 2008
1
hello, all i am new to the site and heard from a friend that it is a very wonderful place to get help. i am stuck with some programming and i really need help. please help me here is the problem :

I want to write a program of two functions. One is add time function and the other one is minus time function. The main
function will call add time and minus time function according to the condition in its own. The program should be like this:


I want to write a program of two functions. One is add time function and the other one is minus time function. The main
function will call add time and minus time function according to the condition in its own. The program should be like this: (attached file)
 

Attachments

Colin Mac

Joined Mar 11, 2008
18
Do you understand, how functions take parameters and return values. More like this:

Rich (BB code):
#include <stdio.h>

int addtime(int btime )
{

  btime = btime + 10;
  return btime; 

}


int minustime(int btime)
{

  btime = btime - 10;
  return btime; 

}


int main(void)
{
  int begintime = 10; 
 
  while(1)
   {
      if (something > something)
      {
	  begintime = addtime (begintime);	 //i want to add 10 ms to beginetime
      }

      if (something < something)
      {
	  begintime = minustime (begintime);	//i want to minuse 10 ms from beginetime
      }
               
   }   
     return 0;
}
 
Top