I am having trouble with my homework problem is:

 float total = 200;
 int - 1;

for (i=1; i,=5;i++)

     {
        total=total/2
      }
      print total:

need output and flow chart

Any help please?

Suggestion zero: When you submit code, put [code] and [/CODE] tags around it. This gives line numbers and syntax highlighting in the display; and keeps your indentation: All good things. Also, when you post to DaniWeb, you agree to follow the DaniWeb rules, one of which is to use [code] tags.

Suggestion one: Run the compiler against your code. Fix the first syntax error. Run it again. Fix the first remaining syntax error. Repeat. When you have the program compiling run it. It will print the output. (Assuming you have fixed the problem of misspelling "printf")

Hint: In C, the main function is declared as int main(void); or, if you need to allow command line arguments, you can use either of int main(int argc, char** argv); or int main(int argc, char *argv[]) (which are different ways to say the same thing)

Flow chart. This program is way too simple to need one. If you must, then I'm sure you will find a way.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.