Author Topic: CB. bug? C programming  (Read 2238 times)

Offline fausto

  • Single posting newcomer
  • *
  • Posts: 3
CB. bug? C programming
« on: January 07, 2017, 07:59:53 pm »
Hi everybody!
I wrote a simply C program with C:B
------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int i;
    for (i = 8; i < 1; i--)
{
    printf("Hello world!\n");
 }
    return 0;
}
-------------------------------------------
The compilation give no errors, but the program don't work  :( :(
Is this a bug?
Thanks, Fausto.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CB. bug? C programming
« Reply #1 on: January 07, 2017, 08:18:32 pm »
What does not work ?
Anything C::B related or programming related ?
In the second case your question violates our forum rules and you should (re-)read the rules.

If it just does not print anything, it's because of the error you made (or you copied the wrong code).

By the way: code should be placed into code-tags (see the "#"-button above the edit-box of the forum).

Offline fausto

  • Single posting newcomer
  • *
  • Posts: 3
Re: CB. bug? C programming
« Reply #2 on: January 08, 2017, 02:30:25 pm »

Sorry, wrong code... :-[ :-[

correct is

   for (i=8;i>1;i--)

Bye, Fausto.