Join us on Discord!
You can help CodeWalrus stay online by donating here.

Useless c i wrote

Started by gameblabla, October 06, 2017, 09:30:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gameblabla

Post here your crappy code that either useless or very poor in quality.
Here's one, that calculates the time that takes for that mom to gain 70000000 kilos in milliseconds.

#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <time.h>

int main(void)
{
    double yourmom = 0.0;
    double timetohold[2];
    double final_result = 0.0;
    struct timespec ts;
   
    timespec_get(&ts, TIME_UTC);
    timetohold[0] = ts.tv_nsec;
   
    while (yourmom < 70000000)
    {
    yourmom += 1.0;
    }

    timespec_get(&ts, TIME_UTC);
    timetohold[1] = ts.tv_nsec;
    final_result = timetohold[1] - timetohold[0];
    printf("Your mom gained 70000000 kilos in %f milliseconds\n", final_result / 1000000);
    return 0;
}

  • Calculators owned: None (used to own an Nspire and TI-89)

Powered by EzPortal