Jan 11, 2012

Membuat Hitungan Mundur di C++

Ini dia codenya copas aja ^_*

/* clock example: countdown */
#include <stdio.h>
#include <time.h>

void wait ( int seconds )
{
  clock_t endwait;
  endwait = clock () + seconds * CLOCKS_PER_SEC ;
  while (clock() < endwait) {}
}

int main ()
{
  int n;
  printf ("Starting countdown...\n");
  for (n=1000; n>0; n--)
  {
    printf ("%d\n",n);
    wait (1);
  }
  printf ("FIRE!!!\n");
  return 0;
}

Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : Membuat Hitungan Mundur di C++