C Goodies - Printable Version +- Forums - Open Redstone Engineers (https://forum.openredstone.org) +-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html) +--- Forum: Programming (https://forum.openredstone.org/forum-8.html) +--- Thread: C Goodies (/thread-262.html) |
C Goodies - Malcolmforde - 05-24-2013 I was being a derp and invented a very derpy command system in C. It only accepts numbers as commands and derps if you enter anything other than a number :3 And yes, I am very new to C. Don't blab at me. Screenshot: And the source code: https://dl.dropboxusercontent.com/u/59183206/Command.c Oh yes, I will also be using this for a text adventure. RE: C Goodies - Cutlassw30 - 05-24-2013 #include<stdio.h> #include<stdlib.h> int main(void){ float B2; float B; int E; printf("Enter the base: "); scanf("%f", &B); printf("Enter the exponent: "); scanf("%d", &E); if (E==0 && B!=0){ printf("The result is: 1 "); } else if (E==0 && B==0){ printf("The result is: Indeterminate "); } B2=B; while(E!=1){ E=E-1; B=B*B2; } printf("The result is: %f",B); getch(); } RE: C Goodies - mad1231999 - 05-24-2013 https://github.com/Mads-Clausen/TextEditor RE: C Goodies - Malcolmforde - 05-24-2013 (05-24-2013, 08:05 AM)mad1231999 Wrote: https://github.com/Mads-Clausen/TextEditor STOP ADVERTISING YOU ASSHAT RE: C Goodies - mad1231999 - 05-25-2013 Type ""0"" What is this sorcery? RE: C Goodies - Malcolmforde - 05-26-2013 (05-25-2013, 08:28 AM)mad1231999 Wrote: Type ""0"" I was testin crap |