You are browsing as a guest. Sign up (or log in) to start making projects!

Semicolonless C Compiler

  • 3 Devlogs
  • 4 Total hours

ts is as cursed as it sounds. it STILL IGNORES NEWLINES like normal C so you can type oneliners like `int i,j float f char c scanf("%d",&i) printf("%d",i+1)` in one line with no semicolon

Open comments for this post

3h 17m logged

add python style indenting

now this is valid code:

#include <stdio.h>

int main():
    float a,b int c float cache=1
    printf("Input some numbers: ")
    if (scanf("%f %f %d",&a,&b,&c)!=3):
        printf("Invalid input.\n")
        return 1
    printf("\n")
    if(b==0):
        printf("b is zero\n")
    else:
        printf("%f/%f = %f\n",a,b,a/b)
    if(c>=0):
        for (int i=0 i>c i++):
            cache*=a
        printf("%f^%d = %f\n",a,c,cache)
    else:
        printf("c is negative\n")
    return 0

yeah this is so cursed.
this is the output of the code:

1
0
23

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…