0

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?

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by griswolf
0

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.

Edited by griswolf: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.