miércoles, 10 de octubre de 2012

The Scheduler

I have encoded  a simulator  of the scheduler in C for five process, it can be changed, added or modify the service time, thsi work with FIFO or FCFS, enjoy it...


        "Here code"
       |
       |
       V
       scheduler.c

lunes, 8 de octubre de 2012

Do you program stylishly [?]


How to found a good programmer or an excellent developer and don´t die in the try, with a simple test we can to know their skills.
“Write a program that prints the numbers 1 at 100, but for the multiples of three prints “Fizz” instead of the number, and for the multiples of five prints “Buzz”. For the multiples or both, prints “FizzBuzz” ”.

Perhaps a “for” and some “if´s and else´s” can solve the problem, but: is it sufficient? How do you solve? I posting below my solution in language “C” and I hope yours.

#include <stdio.h>
main(){
  int i;
  for( i=1; i<=100; i++ )
      printf( (i%15==0) ? "FizzBuzz ": (i%3==0) ? "Fizz " : (i%5==0) ? "Buzz " : "%d ",i );
}