the Wednesday, August 23

Concept Software

Just an idea. Natural language compiler.

Me:Make an integer called total.int total;


Me: Make an integer called total.
Me: Add a comment at the beginning: "This program should find the factorial of an integer."
/* This program should find the factorial of an integer. */
int total;


Me: Make an integer called total.
Me: Add a comment at the beginning: "This program should find the factorial of an integer."
Me: Create a for loop from 1 to 5 that multipies i by total.
Program: "total" has not been initialized. What should it's initial value be?
/* This program should find the factorial of an integer. */
int total;
for(int i=1; i<5; i++) i*=total;


Me: Make an integer called total.
Me: Add a comment at the beginning: "This program should find the factorial of an integer."
Me: Create a std for loop that multipies i by total.
Program: "total" has not been initialized. What should it's initial value be?
Me: 1. Then output total. Then run.
Run: 120
/* This program should find the factorial of an integer. */
int total=1;
for(int i=1; i<5; i++) i*=total;
printf(total);